Trait RootContext

Source
pub trait RootContext: BaseContext + Any {
    // Required method
    fn create_context(&mut self) -> Context;

    // Provided methods
    fn on_vm_start(&mut self, configuration: Option<Vec<u8>>) -> bool { ... }
    fn on_configure(&mut self, configuration: Option<Vec<u8>>) -> bool { ... }
    fn on_tick(&mut self) { ... }
}

Required Methods§

Source

fn create_context(&mut self) -> Context

Called to initiate a new HTTP or Stream context.

Provided Methods§

Source

fn on_vm_start(&mut self, configuration: Option<Vec<u8>>) -> bool

If returns true, VM startup is successful (and shall continue) If returns false, VM startup is a failure and will be aborted.

Source

fn on_configure(&mut self, configuration: Option<Vec<u8>>) -> bool

If returns true, VM startup is successful (and shall continue) If returns false, VM startup is a failure and will be aborted.

Source

fn on_tick(&mut self)

Called every tick period as set by crate::time::set_tick_period

Trait Implementations§

Source§

impl<R: RootContext> From<Box<R>> for Box<dyn RootContext>

Source§

fn from(value: Box<R>) -> Self

Converts to this type from the input type.

Implementors§