Struct ReadHalf

pub struct ReadHalf<T> { /* private fields */ }

The readable half of a value returned from split.

Implementations

impl<T> ReadHalf<T>

fn is_pair_of(&self, other: &WriteHalf<T>) -> bool

Checks if this ReadHalf and some WriteHalf were split from the same stream.

fn unsplit(self, wr: WriteHalf<T>) -> T
where
    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 calling is_pair_of().

Trait Implementations

impl<T: AsyncRead> AsyncRead for ReadHalf<T>

fn poll_read(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll<Result<()>>

impl<T: Debug> Debug for ReadHalf<T>

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

impl<T: Send> Send for ReadHalf<T>

impl<T: Sync> Sync for ReadHalf<T>

Auto Trait Implementations

impl<T> Freeze for ReadHalf<T> where Arc<Inner<T>>: Freeze,

impl<T> RefUnwindSafe for ReadHalf<T> where Arc<Inner<T>>: RefUnwindSafe,

impl<T> Unpin for ReadHalf<T> where Arc<Inner<T>>: Unpin,

impl<T> UnsafeUnpin for ReadHalf<T> where Arc<Inner<T>>: UnsafeUnpin,

impl<T> UnwindSafe for ReadHalf<T> where Arc<Inner<T>>: UnwindSafe,

Blanket Implementations

impl<R> AsyncReadExt for ReadHalf<T> where R: AsyncRead + ?Sized,

impl<T> Any for ReadHalf<T> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for ReadHalf<T> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for ReadHalf<T> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for ReadHalf<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for ReadHalf<T> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for ReadHalf<T> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for ReadHalf<T> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>