TokioServiceHandler

Trait TokioServiceHandler 

Source
pub trait TokioServiceHandler {
    type AppErr;

    // Required methods
    fn init<'life0, 'async_trait>(
        &'life0 mut self,
        ictx: InitCtx,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::AppErr>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn run<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        re: &'life1 RunEnv,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::AppErr>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn shutdown<'life0, 'async_trait>(
        &'life0 mut self,
        tctx: TermCtx,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::AppErr>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Available on crate features rt and tokio only.
Expand description

async server application built on the tokio runtime.

Implement this for an object that wraps a server application that uses tokio as an async runtime.

Required Associated Types§

Required Methods§

Source

fn init<'life0, 'async_trait>( &'life0 mut self, ictx: InitCtx, ) -> Pin<Box<dyn Future<Output = Result<(), Self::AppErr>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn run<'life0, 'life1, 'async_trait>( &'life0 mut self, re: &'life1 RunEnv, ) -> Pin<Box<dyn Future<Output = Result<(), Self::AppErr>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn shutdown<'life0, 'async_trait>( &'life0 mut self, tctx: TermCtx, ) -> Pin<Box<dyn Future<Output = Result<(), Self::AppErr>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§