Trait ReadTimeout
pub trait ReadTimeout {
// Required method
fn set_read_timeout(&self, timeout: Option<Duration>) -> Result<(), Error>;
}Expand description
A blocking transport whose reads can be bounded in time, as the _until loops need to end
at their deadline.
Implemented for TcpStream and &TcpStream (a socket shared with another thread, which
may shut it down). A transport that cannot time out implements it as a no-op; a loop over
it then checks its deadline only between reads, and a read that never returns holds it
past the deadline.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".