Skip to main content

OwnedReadHalf

Struct OwnedReadHalf 

Source
pub struct OwnedReadHalf<S>(/* private fields */);
Expand description

The read half of a stream, owning it with the write half.

Implementations§

Source§

impl<S> OwnedReadHalf<S>

Source

pub fn reunite( self, other: OwnedWriteHalf<S>, ) -> Result<Handle<S>, ReuniteError<S>>

The stream again, from its two halves.

§Errors

When other is a half of another stream; both are given back.

Trait Implementations§

Source§

impl<S> AsRef<Handle<S>> for OwnedReadHalf<S>

Source§

fn as_ref(&self) -> &Handle<S>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<S> AsyncRead for OwnedReadHalf<S>
where for<'x> &'x Handle<S>: AsyncRead,

Source§

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

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

fn poll_read_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &mut [IoSliceMut<'_>], ) -> Poll<Result<usize>>

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

impl<S: Debug> Debug for OwnedReadHalf<S>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<S> !RefUnwindSafe for OwnedReadHalf<S>

§

impl<S> !UnwindSafe for OwnedReadHalf<S>

§

impl<S> Freeze for OwnedReadHalf<S>

§

impl<S> Send for OwnedReadHalf<S>
where S: Sync + Send,

§

impl<S> Sync for OwnedReadHalf<S>
where S: Sync + Send,

§

impl<S> Unpin for OwnedReadHalf<S>

§

impl<S> UnsafeUnpin for OwnedReadHalf<S>

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<R> AsyncReadExt for R
where R: AsyncRead + ?Sized,

Source§

fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self> ⓘ
where Self: Unpin,

Reads some bytes into buf, answering how many (0 at the end).
Source§

fn read_buf<'a, 'b>( &'a mut self, buf: &'a mut ReadBuf<'b>, ) -> ReadBufFuture<'a, 'b, Self> ⓘ
where Self: Unpin,

Reads some bytes into the unfilled part of buf and counts them filled, answering how many (0 at the end, or when buf is full).
Source§

fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self> ⓘ
where Self: Unpin,

Fills buf exactly, answering its length; an end of the stream first is an UnexpectedEof error.
Source§

fn read_to_end<'a>(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEnd<'a, Self> ⓘ
where Self: Unpin,

Reads to the end of the stream, appending to buf; answers how many bytes it appended.
Source§

fn read_to_string<'a>( &'a mut self, buf: &'a mut String, ) -> ReadToString<'a, Self> ⓘ
where Self: Unpin,

Reads to the end of the stream, appending to buf if what it read is UTF-8 (an InvalidData error and buf as it was otherwise); answers how many bytes it appended.
Source§

fn take(self, limit: u64) -> Take<Self>
where Self: Sized,

A reader that ends after limit bytes of this one.
Source§

fn chain<R: AsyncRead>(self, next: R) -> Chain<Self, R>
where Self: Sized,

A reader that reads this one to its end, then next.
Source§

fn read_u8(&mut self) -> ReadNumber<'_, Self, u8, 1> ⓘ
where Self: Unpin,

Reads an unsigned byte (1 bytes, exactly).
Source§

fn read_i8(&mut self) -> ReadNumber<'_, Self, i8, 1> ⓘ
where Self: Unpin,

Reads a signed byte (1 bytes, exactly).
Source§

fn read_u16(&mut self) -> ReadNumber<'_, Self, u16, 2> ⓘ
where Self: Unpin,

Reads a big-endian u16 (2 bytes, exactly).
Source§

fn read_u16_le(&mut self) -> ReadNumber<'_, Self, u16, 2> ⓘ
where Self: Unpin,

Reads a little-endian u16 (2 bytes, exactly).
Source§

fn read_i16(&mut self) -> ReadNumber<'_, Self, i16, 2> ⓘ
where Self: Unpin,

Reads a big-endian i16 (2 bytes, exactly).
Source§

fn read_i16_le(&mut self) -> ReadNumber<'_, Self, i16, 2> ⓘ
where Self: Unpin,

Reads a little-endian i16 (2 bytes, exactly).
Source§

fn read_u32(&mut self) -> ReadNumber<'_, Self, u32, 4> ⓘ
where Self: Unpin,

Reads a big-endian u32 (4 bytes, exactly).
Source§

fn read_u32_le(&mut self) -> ReadNumber<'_, Self, u32, 4> ⓘ
where Self: Unpin,

Reads a little-endian u32 (4 bytes, exactly).
Source§

fn read_i32(&mut self) -> ReadNumber<'_, Self, i32, 4> ⓘ
where Self: Unpin,

Reads a big-endian i32 (4 bytes, exactly).
Source§

fn read_i32_le(&mut self) -> ReadNumber<'_, Self, i32, 4> ⓘ
where Self: Unpin,

Reads a little-endian i32 (4 bytes, exactly).
Source§

fn read_u64(&mut self) -> ReadNumber<'_, Self, u64, 8> ⓘ
where Self: Unpin,

Reads a big-endian u64 (8 bytes, exactly).
Source§

fn read_u64_le(&mut self) -> ReadNumber<'_, Self, u64, 8> ⓘ
where Self: Unpin,

Reads a little-endian u64 (8 bytes, exactly).
Source§

fn read_i64(&mut self) -> ReadNumber<'_, Self, i64, 8> ⓘ
where Self: Unpin,

Reads a big-endian i64 (8 bytes, exactly).
Source§

fn read_i64_le(&mut self) -> ReadNumber<'_, Self, i64, 8> ⓘ
where Self: Unpin,

Reads a little-endian i64 (8 bytes, exactly).
Source§

fn read_u128(&mut self) -> ReadNumber<'_, Self, u128, 16> ⓘ
where Self: Unpin,

Reads a big-endian u128 (16 bytes, exactly).
Source§

fn read_u128_le(&mut self) -> ReadNumber<'_, Self, u128, 16> ⓘ
where Self: Unpin,

Reads a little-endian u128 (16 bytes, exactly).
Source§

fn read_i128(&mut self) -> ReadNumber<'_, Self, i128, 16> ⓘ
where Self: Unpin,

Reads a big-endian i128 (16 bytes, exactly).
Source§

fn read_i128_le(&mut self) -> ReadNumber<'_, Self, i128, 16> ⓘ
where Self: Unpin,

Reads a little-endian i128 (16 bytes, exactly).
Source§

fn read_f32(&mut self) -> ReadNumber<'_, Self, f32, 4> ⓘ
where Self: Unpin,

Reads a big-endian f32 (4 bytes, exactly).
Source§

fn read_f32_le(&mut self) -> ReadNumber<'_, Self, f32, 4> ⓘ
where Self: Unpin,

Reads a little-endian f32 (4 bytes, exactly).
Source§

fn read_f64(&mut self) -> ReadNumber<'_, Self, f64, 8> ⓘ
where Self: Unpin,

Reads a big-endian f64 (8 bytes, exactly).
Source§

fn read_f64_le(&mut self) -> ReadNumber<'_, Self, f64, 8> ⓘ
where Self: Unpin,

Reads a little-endian f64 (8 bytes, exactly).
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.

§

impl<T> MaybeSend for T
where T: Send + ?Sized,

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.