[−][src]Trait drone_core::proc_loop::ProcLoop
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>
Token type that allows suspending the task while waiting for a request result.
type Cmd: Send + 'static
enum
of all possible commands.
type CmdRes: Send + 'static
union
of all possible command results.
type Req: Send + 'static
enum
of all possible requests.
type ReqRes: Send + 'static
union
of all possible request results.
Associated Constants
const STACK_SIZE: usize
Size of the process stack in bytes.
Required methods
fn run_cmd(cmd: Self::Cmd, context: Self::Context) -> Self::CmdRes
The commands runner.
See ProcLoop
for examples.
Provided methods
fn on_create()
Runs on the process creation.
fn on_enter()
Runs inside the synchronous context before the command loop.
fn on_drop()
Runs on the process destruction.