[][src]Trait spirit_tokio::net::StreamConfig

pub trait StreamConfig<S> {
    fn configure(&self, stream: &mut S) -> Result<(), IoError>;
}

Abstracts over a configuration subfragment that applies further settings to an already accepted stream.

The fragments that accept connections can apply some configuration to them after they have been accepted but before handling them to the rest of the application. The trait is generic over the type of connections accepted.

The Empty fragment provides a default configuration that does nothing.

Required methods

fn configure(&self, stream: &mut S) -> Result<(), IoError>

Applies the configuration to the stream.

If the configuration fails and error is returned, the connection is dropped (and the error is logged).

Loading content...

Implementations on Foreign Types

impl<S> StreamConfig<S> for Empty[src]

Loading content...

Implementors

impl StreamConfig<TcpStream> for TcpConfig[src]

Loading content...