Skip to main content

LoopbackConnect

Type Alias LoopbackConnect 

Source
pub type LoopbackConnect = Connect<'static, SendError, Infallible>;
Available on crate feature rch only.
Expand description

A loopback connection.

Aliased Type§

pub struct LoopbackConnect(/* private fields */);

Implementations§

Source§

impl LoopbackConnect

Source

pub async fn loopback<Tx, Rx, Codec>( cfg: Cfg, ) -> (LoopbackConnect, Sender<Tx, Codec>, Receiver<Rx, Codec>)
where Tx: RemoteSend, Rx: RemoteSend, Codec: Codec,

Establishes a connection over a local loopback transport and returns a sender and receiver.

This establishes a chmux connection over the loopback transport and opens a channel.

You must poll the returned Connect future or spawn it for the connection to work.

§Panics

Panics if the chmux configuration is invalid.