[][src]Struct tokio_io_timeout::TimeoutReader

pub struct TimeoutReader<R> { /* fields omitted */ }

An AsyncReader which applies a timeout to read operations.

Implementations

impl<R> TimeoutReader<R> where
    R: AsyncRead
[src]

pub fn new(reader: R) -> TimeoutReader<R>[src]

Returns a new TimeoutReader wrapping the specified reader.

There is initially no timeout.

pub fn timeout(&self) -> Option<Duration>[src]

Returns the current read timeout.

pub fn set_timeout(&mut self, timeout: Option<Duration>)[src]

Sets the read timeout.

This will reset any pending timeout.

pub fn get_ref(&self) -> &R[src]

Returns a shared reference to the inner reader.

pub fn get_mut(&mut self) -> &mut R[src]

Returns a mutable reference to the inner reader.

pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut R>[src]

Returns a pinned mutable reference to the inner reader.

pub fn into_inner(self) -> R[src]

Consumes the TimeoutReader, returning the inner reader.

Trait Implementations

impl<R> AsyncRead for TimeoutReader<R> where
    R: AsyncRead
[src]

impl<R> AsyncWrite for TimeoutReader<R> where
    R: AsyncWrite
[src]

impl<R: Debug> Debug for TimeoutReader<R>[src]

impl<'pin, R> Unpin for TimeoutReader<R> where
    __TimeoutReader<'pin, R>: Unpin
[src]

Auto Trait Implementations

impl<R> !RefUnwindSafe for TimeoutReader<R>[src]

impl<R> Send for TimeoutReader<R> where
    R: Send
[src]

impl<R> Sync for TimeoutReader<R> where
    R: Sync
[src]

impl<R> !UnwindSafe for TimeoutReader<R>[src]

Blanket Implementations

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

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized
[src]

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?Sized
[src]

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

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

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

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

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.

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.