Trait ServiceStable

Source
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§

Source

fn on_health_check(&self, context: &PicoContext) -> RResult<(), ()>

Source

fn on_start( &mut self, context: &PicoContext, configuration: RSlice<'_, u8>, ) -> RResult<(), ()>

Source

fn on_stop(&mut self, context: &PicoContext) -> RResult<(), ()>

Source

fn on_leader_change(&mut self, context: &PicoContext) -> RResult<(), ()>

Source

fn on_config_change( &mut self, ctx: &PicoContext, new_config: RSlice<'_, u8>, old_config: RSlice<'_, u8>, ) -> RResult<(), ()>

Implementors§

Source§

impl<'lt, _ErasedPtr> ServiceStable for ServiceStable_TO<'lt, _ErasedPtr>
where Self:, _ErasedPtr: AsMutPtr<PtrTarget = ()>,

Source§

impl<C: DeserializeOwned> ServiceStable for ServiceProxy<C>