Service

Trait Service 

Source
pub trait Service:
    Sized
    + Send
    + Sync
    + 'static {
    type Message: Send + 'static;
    type ClientMethods: ClientMethods<Self>;

    // Required methods
    fn create(app: &App) -> Self;
    fn handle(
        self: Arc<Self>,
        msg: Self::Message,
    ) -> impl Future<Output = ()> + Send;
}

Required Associated Types§

Required Methods§

Source

fn create(app: &App) -> Self

Source

fn handle( self: Arc<Self>, msg: Self::Message, ) -> impl Future<Output = ()> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§