Skip to main content

WriteTimeout

Trait WriteTimeout 

Source
pub trait WriteTimeout {
    // Required method
    fn set_write_timeout(&self, timeout: Option<Duration>) -> Result<()>;
}
Expand description

A blocking transport whose writes can be bounded in time, as the _until loops need when the peer stops reading.

Implemented for TcpStream and &TcpStream. A transport that cannot time out implements it as a no-op; a write the peer never drains then holds the loop past its deadline.

Required Methods§

Source

fn set_write_timeout(&self, timeout: Option<Duration>) -> Result<()>

Sets the timeout of every write from now on; None waits forever.

§Errors

When the transport refuses the setting.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl WriteTimeout for &TcpStream

Source§

impl WriteTimeout for TcpStream

Implementors§