Skip to main content

TypedAccept

Trait TypedAccept 

Source
pub trait TypedAccept {
    // Required method
    fn accept_typed<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<TypedStream, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Typed analogue to the Accept trait.

Required Methods§

Source

fn accept_typed<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<TypedStream, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Accept a typed stream.

Because typed streams are indistinguishable from untyped streams, if the remote isn’t sending a type, then the first 4 bytes of data will be misinterpreted as the stream type.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<S> TypedAccept for Heartbeat<S>
where S: TypedAccept + Send,

Source§

impl<S> TypedAccept for Typed<S>
where S: Accept + Send,