Skip to main content

Write

Trait Write 

Source
pub trait Write: Write {
    // Required method
    fn set_write_deadline(&mut self, deadline: Instant) -> Result<()>;
}
Expand description

A standard byte writer whose writes and flushes honor an absolute deadline.

The installed deadline covers partial writes and flush. Progress does not restart it. Expiration returns TimedOut and leaves the adapter open and reusable. Each write reports accepted bytes through the standard io::Write contract. A frame can therefore fail after earlier writes accepted a prefix. Successful output does not guarantee that the peer received or processed it.

Pending transfers must remain ordered before subsequent output or be cancelled before that output begins. An abandoned operation must never append bytes out of order after a later call starts writing. The adapter must bound actual I/O.

Required Methods§

Source

fn set_write_deadline(&mut self, deadline: Instant) -> Result<()>

Installs the deadline for subsequent writes and flushes until replaced. Returns promptly, transfers no bytes and leaves the read deadline unchanged. Operations attempted after expiration return TimedOut. If this setter fails, transport returns the error without attempting a write or flush.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: Write + ?Sized> Write for &mut T

Source§

fn set_write_deadline(&mut self, deadline: Instant) -> Result<()>

Source§

impl<T: Write + ?Sized> Write for Box<T>

Source§

fn set_write_deadline(&mut self, deadline: Instant) -> Result<()>

Implementors§