crb_runtime::runtime

Trait SupervisedRuntime

Source
pub trait SupervisedRuntime
where Self: Send + 'static,
{ type Context: Context; // Required methods fn get_interruptor(&mut self) -> Box<dyn Interruptor>; fn routine<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait; fn context(&self) -> &Self::Context; }
Expand description

A runtime that can be executed by a supervisor.

Required Associated Types§

Source

type Context: Context

Type of the composable block’s contenxt.

Required Methods§

Source

fn get_interruptor(&mut self) -> Box<dyn Interruptor>

Used by a lifetime tracker of the supervisor to stop it. It’s the separate type that wraps address made by a runtime.

Source

fn routine<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,

Interruptor can interrupt this routine.

The notifier is passed by a reference to fully avoid cloning or passing it somewhere to let it outlive this trackable object.

Source

fn context(&self) -> &Self::Context

Gets a reference to a context.

Implementors§