[][src]Struct tokio_io_timeout::TimeoutWriter

pub struct TimeoutWriter<W> { /* fields omitted */ }

An AsyncWriteer which applies a timeout to write operations.

Implementations

impl<W> TimeoutWriter<W> where
    W: AsyncWrite
[src]

pub fn new(writer: W) -> TimeoutWriter<W>[src]

Returns a new TimeoutReader wrapping the specified reader.

There is initially no timeout.

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

Returns the current write timeout.

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

Sets the write timeout.

This will reset any pending timeout.

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

Returns a shared reference to the inner writer.

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

Returns a mutable reference to the inner writer.

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

Returns a pinned mutable reference to the inner writer.

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

Consumes the TimeoutWriter, returning the inner writer.

Trait Implementations

impl<W> AsyncRead for TimeoutWriter<W> where
    W: AsyncRead
[src]

impl<W> AsyncWrite for TimeoutWriter<W> where
    W: AsyncWrite
[src]

impl<W: Debug> Debug for TimeoutWriter<W>[src]

impl<'__pin, W> Unpin for TimeoutWriter<W> where
    __Origin<'__pin, W>: Unpin
[src]

Auto Trait Implementations

impl<W> !RefUnwindSafe for TimeoutWriter<W>[src]

impl<W> Send for TimeoutWriter<W> where
    W: Send
[src]

impl<W> Sync for TimeoutWriter<W> where
    W: Sync
[src]

impl<W> !UnwindSafe for TimeoutWriter<W>[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.