Skip to main content

Reactor

Trait Reactor 

Source
pub trait Reactor: Driver {
    // Required methods
    fn tcp_connect(&self, addr: SocketAddr, cfg: SharedCfg) -> Receiver<Io> ⓘ;
    fn unix_connect(&self, addr: PathBuf, cfg: SharedCfg) -> Receiver<Io> ⓘ;
    fn from_tcp_stream(
        &self,
        stream: TcpStream,
        cfg: SharedCfg,
    ) -> Result<Io, Error>;
    fn from_unix_stream(&self, _: UnixStream, _: SharedCfg) -> Result<Io, Error>;
}
Expand description

Runtime reactor used for network connection and transport operations.

Required Methods§

Source

fn tcp_connect(&self, addr: SocketAddr, cfg: SharedCfg) -> Receiver<Io> ⓘ

Starts an asynchronous TCP connection.

Source

fn unix_connect(&self, addr: PathBuf, cfg: SharedCfg) -> Receiver<Io> ⓘ

Starts an asynchronous Unix domain socket connection.

Source

fn from_tcp_stream( &self, stream: TcpStream, cfg: SharedCfg, ) -> Result<Io, Error>

Converts a standard-library TCP stream into an Io value.

Source

fn from_unix_stream(&self, _: UnixStream, _: SharedCfg) -> Result<Io, Error>

Converts a standard-library Unix stream into an Io value.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl Reactor for ntex::rt::polling::Reactor

Source§

impl Reactor for ntex::rt::uring::Reactor

Source§

impl Reactor for ntex::rt::tokio::Reactor