Trait Io

Source
pub trait Io {
    type Output;

    // Required method
    fn connect(&mut self) -> PinFut<Result<Self::Output, Error>>;

    // Provided method
    fn reconnect(&mut self) -> PinFut<Result<Self::Output, Error>> { ... }
}
Expand description

Represents an I/O source capable of reconnecting

This trait is implemented for a number of types in the library, with the implementations placed behind feature flags

Required Associated Types§

Required Methods§

Source

fn connect(&mut self) -> PinFut<Result<Self::Output, Error>>

Initializes the connection to the I/O source

Provided Methods§

Source

fn reconnect(&mut self) -> PinFut<Result<Self::Output, Error>>

Re-establishes the connection to the I/O source

Implementors§

Source§

impl<A> Io for TcpConnector<A>
where A: 'static + ToSocketAddrs + Clone + Send + Sync,

Source§

impl<P> Io for UnixConnector<P>
where P: AsRef<Path>,