pub trait SplitStream: Unpin {
type Ingress<'i>: AsyncRead + Unpin
where Self: 'i;
type Egress<'e>: AsyncWrite + Unpin
where Self: 'e;
// Required method
fn split(&mut self) -> (Self::Ingress<'_>, Self::Egress<'_>);
}Expand description
Helper trait for efficiently splitting a stream into read and write halves.
Required Associated Types§
Sourcetype Ingress<'i>: AsyncRead + Unpin
where
Self: 'i
type Ingress<'i>: AsyncRead + Unpin where Self: 'i
Associated type for the read half of the stream. These can be a non-owning reference to avoid unnecessary heap allocations and reference counting.
Sourcetype Egress<'e>: AsyncWrite + Unpin
where
Self: 'e
type Egress<'e>: AsyncWrite + Unpin where Self: 'e
Associated type for the write half of the stream. These can be a non-owning reference to avoid unnecessary heap allocations and reference counting.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".