# tokio::io::ReadHalf - Rust
API documentation for the Rust `ReadHalf` struct in crate `tokio`.
Keywords: rust, rustlang, rust-lang, ReadHalf

# Struct tokio::io::ReadHalf [−] [src]

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

The readable half of a value returned from `split`.

## Implementations

### `impl<T> ReadHalf<T>` [src]

#### `pub fn is_pair_of(&self, other: &WriteHalf<T>) -> bool` [src]

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

#### `pub fn unsplit(self, wr: WriteHalf<T>) -> T` [src]

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.

## Trait Implementations

### `impl<T: AsyncRead> AsyncRead for ReadHalf<T>` [src]

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

Attempts to read from the `AsyncRead` into `buf`. Read more

### `impl<T: Debug> Debug for ReadHalf<T>` [src]

#### `fn fmt(&self, fmt: &mut Formatter<'_>) -> Result` [src]

Formats the value using the given formatter. Read more

### `impl<T: Send> Send for ReadHalf<T>` [src]

### `impl<T: Sync> Sync for ReadHalf<T>` [src]

## Auto Trait Implementations

### `impl<T> !RefUnwindSafe for ReadHalf<T>` [src]

### `impl<T> Unpin for ReadHalf<T>` [src]

### `impl<T> !UnwindSafe for ReadHalf<T>` [src]

## Blanket Implementations

### `impl<T> Any for T where
T: 'static + ?Sized,` [src]

#### `pub fn type_id(&self) -> TypeId` [src]

Gets the `TypeId` of `self`. Read more

### `impl<T> Borrow<T> for T where
T: ?Sized,` [src]

#### `pub fn borrow(&self) -> &Tⓘ

### Notable traits for &'_ mut F

`impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;`
` [src]

Immutably borrows from an owned value. Read more

### `impl<T> BorrowMut<T> for T where
T: ?Sized,` [src]

#### `pub fn borrow_mut(&mut self) -> &mut Tⓘ

### Notable traits for &'_ mut F

`impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;`
` [src]

Mutably borrows from an owned value. Read more

### `impl<T> From<T> for T` [src]

#### `pub fn from(t: T) -> T` [src]

Performs the conversion.

### `impl<T, U> Into<U> for T where
U: From<T>,` [src]

#### `pub fn into(self) -> U` [src]

Performs the conversion.

### `impl<T, U> TryFrom<U> for T where
U: Into<T>,` [src]

#### `type Error = Infallible`

The type returned in the event of a conversion error.

#### `pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>` [src]

Performs the conversion.

### `impl<T, U> TryInto<U> for T where
U: TryFrom<T>,` [src]

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

The type returned in the event of a conversion error.

#### `pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>` [src]

Performs the conversion.