Trait servers::server::Server

source ·
pub trait Server: Send + Sync {
    // Required methods
    fn shutdown<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn start<'life0, 'async_trait>(
        &'life0 self,
        listening: SocketAddr,
    ) -> Pin<Box<dyn Future<Output = Result<SocketAddr>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn name(&self) -> &str;
}

Required Methods§

source

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

Shutdown the server gracefully.

source

fn start<'life0, 'async_trait>( &'life0 self, listening: SocketAddr, ) -> Pin<Box<dyn Future<Output = Result<SocketAddr>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Starts the server and binds on listening.

Caller should ensure start() is only invoked once.

source

fn name(&self) -> &str

Implementors§