Skip to main content

NetworkServer

Trait NetworkServer 

Source
pub trait NetworkServer:
    Send
    + Sync
    + 'static {
    // Required methods
    fn start<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn name(&self) -> &str;
}
Expand description

Common trait for network servers that can be spawned

Required Methods§

Source

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

Start the server and run its main loop

Source

fn name(&self) -> &str

Get the server name for logging

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§