Skip to main content

Dialer

Trait Dialer 

Source
pub trait Dialer: Send {
    // Required method
    fn connect(&self) -> BoxFut<'_, TransportResult<Box<dyn Connection>>>;
}
Expand description

The initiating (client) side — the dual of Listener; dials out and produces the same Connection.

Required Methods§

Source

fn connect(&self) -> BoxFut<'_, TransportResult<Box<dyn Connection>>>

Open a connection to the configured remote.

Trait Implementations§

Source§

impl Dialer for Box<dyn Dialer>

A boxed dialer is itself a Dialer, so a runtime-selected Box<dyn Dialer> — from a scheme:// URL resolver, say — can be passed where run_client<D: Dialer> is expected. The Send supertrait makes the box Send + 'static.

Source§

fn connect(&self) -> BoxFut<'_, TransportResult<Box<dyn Connection>>>

Open a connection to the configured remote.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Dialer for Box<dyn Dialer>

A boxed dialer is itself a Dialer, so a runtime-selected Box<dyn Dialer> — from a scheme:// URL resolver, say — can be passed where run_client<D: Dialer> is expected. The Send supertrait makes the box Send + 'static.

Implementors§

Source§

impl<C: Connection + 'static> Dialer for OneShotDialer<C>

Source§

impl<D, FF, const RC: usize, const WC: usize> Dialer for FramingDialer<D, FF, RC, WC>
where D: StreamDialer + Send + Sync, FF: FramerFactory + Send + Sync, D::Stream: 'static, FF::Framer: 'static,