Lifecycle

Trait Lifecycle 

Source
pub trait Lifecycle: Send + 'static {
    type S: Stop;

    // Required method
    fn start<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Self::S> + Send + 'async_trait>>
       where Self: 'async_trait;

    // Provided method
    fn concrete<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = ConcreteLifecycle> + Send + 'async_trait>>
       where Self: Sized + 'async_trait { ... }
}

Required Associated Types§

Required Methods§

Source

fn start<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Self::S> + Send + 'async_trait>>
where Self: 'async_trait,

Provided Methods§

Source

fn concrete<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = ConcreteLifecycle> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Implementors§

Source§

impl Lifecycle for ConcreteLifecycle

Source§

impl Lifecycle for NoLife

Source§

impl<F, R, O> Lifecycle for F
where F: FnOnce() -> R + 'static + Send, R: Future<Output = O> + Send, O: Stop,

Source§

type S = O