Trait ServerConfiguration

Source
pub trait ServerConfiguration:
    Send
    + Clone
    + 'static {
    type Item: Send + 'static;
    type Factory: ServiceFactory<Self::Item> + 'static;

    // Required method
    async fn create(&self) -> Result<Self::Factory, ()>;

    // Provided methods
    fn paused(&self) { ... }
    fn resumed(&self) { ... }
    fn terminate(&self) { ... }
    async fn stop(&self) { ... }
}
Expand description

Worker service factory.

Required Associated Types§

Source

type Item: Send + 'static

Source

type Factory: ServiceFactory<Self::Item> + 'static

Required Methods§

Source

async fn create(&self) -> Result<Self::Factory, ()>

Create service factory for handling WorkerMessage<T> messages.

Provided Methods§

Source

fn paused(&self)

Server is paused.

Source

fn resumed(&self)

Server is resumed.

Source

fn terminate(&self)

Server is stopped

Source

async fn stop(&self)

Server is stopped

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§

Source§

impl ServerConfiguration for StreamServer

Worker service factory.

Source§

type Item = Connection

Source§

type Factory = StreamService