Skip to main content

Io

Trait Io 

Source
pub trait Io:
    Read
    + Write
    + Send {
    // Required methods
    fn bound_reads(&mut self, timeout: Duration) -> Result<()>;
    fn bound_writes(&mut self, timeout: Duration) -> Result<()>;

    // Provided method
    fn reopens(&self) -> bool { ... }
}
Expand description

The device side of a port: a PTY master or the TCP peer.

Required Methods§

Source

fn bound_reads(&mut self, timeout: Duration) -> Result<()>

Bound every read by timeout: it ends with TimedOut or WouldBlock.

Source

fn bound_writes(&mut self, timeout: Duration) -> Result<()>

The same for writes.

Provided Methods§

Source

fn reopens(&self) -> bool

The host may open the port again after it closed it. Otherwise its end is final.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Io for TTYPort

Available on Unix only.
Source§

fn bound_reads(&mut self, timeout: Duration) -> Result<()>

Source§

fn bound_writes(&mut self, timeout: Duration) -> Result<()>

Source§

fn reopens(&self) -> bool

Source§

impl Io for TcpStream

Source§

fn bound_reads(&mut self, timeout: Duration) -> Result<()>

Source§

fn bound_writes(&mut self, timeout: Duration) -> Result<()>

Implementors§