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§
Sourcefn 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,
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.