ServerStarter

Trait ServerStarter 

Source
pub trait ServerStarter {
    // Required methods
    fn server_type(&self) -> ServerType;
    fn port(&self) -> u16;
    fn start_server(
        self,
    ) -> impl Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send;
}
Expand description

Common server traits for consistent startup behavior

Required Methods§

Source

fn server_type(&self) -> ServerType

Get the server type

Source

fn port(&self) -> u16

Get the port this server will bind to

Source

fn start_server( self, ) -> impl Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send

Start the server (implementation-specific)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§