trust_dns_proto::tcp

Trait Connect

Source
pub trait Connect: DnsTcpStream {
    // Required method
    fn connect_with_bind<'async_trait>(
        addr: SocketAddr,
        bind_addr: Option<SocketAddr>,
    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
       where Self: 'async_trait;

    // Provided method
    fn connect<'async_trait>(
        addr: SocketAddr,
    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
       where Self: Send + 'async_trait { ... }
}
Expand description

Trait for TCP connection

Required Methods§

Source

fn connect_with_bind<'async_trait>( addr: SocketAddr, bind_addr: Option<SocketAddr>, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: 'async_trait,

connect to tcp with address to connect from

Provided Methods§

Source

fn connect<'async_trait>( addr: SocketAddr, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: Send + 'async_trait,

connect to tcp

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§