ServiceTrait

Trait ServiceTrait 

Source
pub trait ServiceTrait: 'static {
    type Item;

    // Required methods
    fn new() -> Self;
    fn register(self, item: Self::Item) -> Self;
    fn init<A>() -> Self
       where A: ApplicationTrait;
    fn run<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>
       where Self: 'async_trait;

    // Provided method
    fn shutdown<'async_trait>(    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> { ... }
}

Required Associated Types§

Required Methods§

Source

fn new() -> Self

Source

fn register(self, item: Self::Item) -> Self

Source

fn init<A>() -> Self

Source

fn run<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>
where Self: 'async_trait,

Provided Methods§

Source

fn shutdown<'async_trait>() -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>

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§