futures_util::io

Struct ReadHalf

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

The readable half of an object returned from AsyncRead::split.

Trait Implementations§

Source§

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

Source§

fn poll_read( &mut self, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<usize, Error>

Attempt to read from the AsyncRead into buf. Read more
Source§

fn poll_vectored_read( &mut self, cx: &mut Context<'_>, vec: &mut [&mut IoVec], ) -> Poll<usize, Error>

Attempt to read from the AsyncRead into vec using vectored IO operations. Read more
Source§

unsafe fn initializer(&self) -> Initializer

Determines if this AsyncReader can work with buffers of uninitialized memory. Read more
Source§

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

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for ReadHalf<T>

§

impl<T> !RefUnwindSafe for ReadHalf<T>

§

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

§

impl<T> Sync for ReadHalf<T>
where T: Send,

§

impl<T> Unpin for ReadHalf<T>

§

impl<T> !UnwindSafe for ReadHalf<T>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn copy_into<W>(self, writer: W) -> CopyInto<Self, W>
where W: AsyncWrite, Self: Sized,

Creates a future which copies all the bytes from one object to another. Read more
Source§

fn read<T>(self, buf: T) -> Read<Self, T>
where T: AsMut<[u8]>, Self: Sized,

Tries to read some bytes directly into the given buf in asynchronous manner, returning a future type. Read more
Source§

fn read_exact<T>(self, buf: T) -> ReadExact<Self, T>
where T: AsMut<[u8]>, Self: Sized,

Creates a future which will read exactly enough bytes to fill buf, returning an error if EOF is hit sooner. Read more
Source§

fn read_to_end(self, buf: Vec<u8>) -> ReadToEnd<Self>
where Self: Sized,

Creates a future which will read all the bytes from this AsyncRead. Read more
Source§

fn split(self) -> (ReadHalf<Self>, WriteHalf<Self>)
where Self: AsyncWrite + Sized,

Helper method for splitting this read/write object into two halves. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.