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

§

type S = NoStop

source§

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

§

type S = O