pub struct ReadHalf<T> { /* private fields */ }
Expand description
The readable half of a value returned from split
.
Implementations§
source§impl<T> ReadHalf<T>
impl<T> ReadHalf<T>
sourcepub fn is_pair_of(&self, other: &WriteHalf<T>) -> bool
pub fn is_pair_of(&self, other: &WriteHalf<T>) -> bool
Checks if this ReadHalf
and some WriteHalf
were split from the same
stream.
sourcepub fn unsplit(self, wr: WriteHalf<T>) -> Twhere
T: Unpin,
pub fn unsplit(self, wr: WriteHalf<T>) -> Twhere
T: Unpin,
Reunites with a previously split WriteHalf
.
Panics
If this ReadHalf
and the given WriteHalf
do not originate from the
same split
operation this method will panic.
This can be checked ahead of time by comparing the stream ID
of the two halves.