Skip to main content

ServerLayer

Trait ServerLayer 

Source
pub trait ServerLayer<In, Out>:
    Send
    + Sync
    + Clone {
    // Required method
    fn handshake(&self, input: In) -> impl Future<Output = Result<Out>> + Send;
}
Expand description

Server-side middleware layer. Upgrades an accepted input via handshake.

Same generic pattern as ClientLayer.

Required Methods§

Source

fn handshake(&self, input: In) -> impl Future<Output = Result<Out>> + Send

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 ServerLayer<Box<dyn ByteStream>, Box<dyn ByteStream>> for TlsLayer

Source§

impl<C> ServerLayer<Box<dyn ByteStream>, WsConn<C>> for WsLayer<C>
where C: Codec<Message> + Clone + Send + Sync + 'static, C::Message: Send + Sync + 'static, C::Error: From<Error> + Into<Error> + Send + Sync,