enum StreamListener {
Tcp(TcpListener),
Tls(TcpListener, Box<TlsLayer>),
}Expand description
Listener for byte-stream transports (TCP, TLS). Accepting is split in
two phases: accept does only the cheap kernel accept, handshake
runs the TLS upgrade. QUIC uses a separate StreamMux path.
Variants§
Tcp(TcpListener)
Tls(TcpListener, Box<TlsLayer>)
Implementations§
Source§impl StreamListener
impl StreamListener
Sourceasync fn accept(&self) -> Result<Box<dyn ByteStream>>
async fn accept(&self) -> Result<Box<dyn ByteStream>>
Kernel accept only. Returns the raw stream before any handshake.
Sourceasync fn handshake(
&self,
stream: Box<dyn ByteStream>,
handshake_timeout: Duration,
) -> Result<Box<dyn ByteStream>>
async fn handshake( &self, stream: Box<dyn ByteStream>, handshake_timeout: Duration, ) -> Result<Box<dyn ByteStream>>
TLS upgrade, if this is a TLS listener. Runs off the accept loop.
fn local_endpoint(&self) -> Result<Endpoint>
Auto Trait Implementations§
impl Freeze for StreamListener
impl !RefUnwindSafe for StreamListener
impl Send for StreamListener
impl Sync for StreamListener
impl Unpin for StreamListener
impl UnsafeUnpin for StreamListener
impl !UnwindSafe for StreamListener
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more