Trait ntex_server::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

Object Safety§

This trait is not object safe.

Implementors§

source§

impl ServerConfiguration for StreamServer

Worker service factory.

source§

type Item = Connection

source§

type Factory = StreamService