pub trait ServiceStable {
// Required methods
fn on_health_check(&self, context: &PicoContext) -> RResult<(), ()>;
fn on_start(
&mut self,
context: &PicoContext,
configuration: RSlice<'_, u8>,
) -> RResult<(), ()>;
fn on_stop(&mut self, context: &PicoContext) -> RResult<(), ()>;
fn on_leader_change(&mut self, context: &PicoContext) -> RResult<(), ()>;
fn on_config_change(
&mut self,
ctx: &PicoContext,
new_config: RSlice<'_, u8>,
old_config: RSlice<'_, u8>,
) -> RResult<(), ()>;
}Expand description
Safe trait for sending a service trait object between ABI boundary.
Define interface like Service trait but using safe types from abi_stable crate.
Required Methods§
fn on_health_check(&self, context: &PicoContext) -> RResult<(), ()>
fn on_start( &mut self, context: &PicoContext, configuration: RSlice<'_, u8>, ) -> RResult<(), ()>
fn on_stop(&mut self, context: &PicoContext) -> RResult<(), ()>
fn on_leader_change(&mut self, context: &PicoContext) -> RResult<(), ()>
fn on_config_change( &mut self, ctx: &PicoContext, new_config: RSlice<'_, u8>, old_config: RSlice<'_, u8>, ) -> RResult<(), ()>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".