pub(crate) struct StreamListener {
pub(crate) inner: Box<dyn TransportListener>,
pub(crate) tls: Option<Box<TlsLayer>>,
}Expand description
Listener for byte-stream transports (TCP, TLS, a user Transport).
Accepting is split in two phases: accept does only the cheap accept,
handshake runs the TLS upgrade. QUIC uses a separate StreamMux path.
Fields§
§inner: Box<dyn TransportListener>§tls: Option<Box<TlsLayer>>Upgrades the accepted streams of a TLS endpoint.
Implementations§
Source§impl StreamListener
impl StreamListener
Sourcepub(crate) fn plain(inner: Box<dyn TransportListener>) -> Self
pub(crate) fn plain(inner: Box<dyn TransportListener>) -> Self
A listener whose streams are used as accepted.
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,
executor: &Executor,
) -> Result<Box<dyn ByteStream>>
async fn handshake( &self, stream: Box<dyn ByteStream>, handshake_timeout: Duration, executor: &Executor, ) -> 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 !RefUnwindSafe for StreamListener
impl !UnwindSafe for StreamListener
impl Freeze for StreamListener
impl Send for StreamListener
impl Sync for StreamListener
impl Unpin for StreamListener
impl UnsafeUnpin 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