Skip to main content

SessionIo

Trait SessionIo 

Source
pub trait SessionIo:
    Read
    + Write
    + Send {
    // Provided methods
    fn set_read_timeout(&mut self, _d: Option<Duration>) -> bool { ... }
    fn set_nonblocking(&mut self, _on: bool) -> bool { ... }
}
Expand description

A byte-stream session: TCP directly, or any registry transport (e.g. noise) wrapped in confium_net::io::TransportIo.

Provided Methods§

Source

fn set_read_timeout(&mut self, _d: Option<Duration>) -> bool

Best-effort read timeout. Returns false when unsupported (non-socket transports are message-framed and their recv blocks only for the next message, which is the desired behavior for a caller that previously set a socket timeout).

Prefer the polling deadline adapter over this hook: under MRI Ruby on windows-gnu the first recv on a socket carrying SO_RCVTIMEO fails WSAENOTSOCK (audit ledger).

Source

fn set_nonblocking(&mut self, _on: bool) -> bool

Best-effort non-blocking toggle for the polling deadline adapter. Returns false when unsupported.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl SessionIo for TcpStream

Source§

fn set_read_timeout(&mut self, d: Option<Duration>) -> bool

Source§

fn set_nonblocking(&mut self, on: bool) -> bool

Source§

impl SessionIo for TransportIo

Implementors§