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§
sourcefn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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.
sourcefn 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 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.