[][src]Trait drone_core::proc_loop::ProcLoop

pub trait ProcLoop: Send + 'static {
    type Context: Context<Self::Req, Self::ReqRes>;
    type Cmd: Send + 'static;
    type CmdRes: Send + 'static;
    type Req: Send + 'static;
    type ReqRes: Send + 'static;

    pub const STACK_SIZE: usize;

    pub fn run_cmd(cmd: Self::Cmd, context: Self::Context) -> Self::CmdRes;

    pub fn on_create() { ... }
pub fn on_enter() { ... }
pub fn on_drop() { ... } }

The trait for declaring a synchronous command loop.

This trait uses only associated items, thus it doesn't require the type to ever be instantiated.

Associated Types

type Context: Context<Self::Req, Self::ReqRes>[src]

Token type that allows suspending the task while waiting for a request result.

type Cmd: Send + 'static[src]

enum of all possible commands.

type CmdRes: Send + 'static[src]

union of all possible command results.

type Req: Send + 'static[src]

enum of all possible requests.

type ReqRes: Send + 'static[src]

union of all possible request results.

Loading content...

Associated Constants

pub const STACK_SIZE: usize[src]

Size of the process stack in bytes.

Loading content...

Required methods

pub fn run_cmd(cmd: Self::Cmd, context: Self::Context) -> Self::CmdRes[src]

The commands runner.

See ProcLoop for examples.

Loading content...

Provided methods

pub fn on_create()[src]

Runs on the process creation.

pub fn on_enter()[src]

Runs inside the synchronous context before the command loop.

pub fn on_drop()[src]

Runs on the process destruction.

Loading content...

Implementors

Loading content...