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§
Sourcefn create_context(&mut self) -> Context
fn create_context(&mut self) -> Context
Called to initiate a new HTTP or Stream context.
Provided Methods§
Sourcefn on_vm_start(&mut self, configuration: Option<Vec<u8>>) -> bool
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.
Sourcefn on_configure(&mut self, configuration: Option<Vec<u8>>) -> bool
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.
Sourcefn on_tick(&mut self)
fn on_tick(&mut self)
Called every tick period as set by crate::time::set_tick_period