Tcp

Trait Tcp 

Source
pub trait Tcp: IoBackend {
    type StreamHandle: TcpStreamHandle;
    type ListenerHandle: TcpListenerHandle<StreamHandle = Self::StreamHandle>;
    type ConnectFuture<'a, A: ToSocketAddrs + Send + 'a>: Future<Output = MfioResult<Self::StreamHandle>> + 'a
       where Self: 'a;
    type BindFuture<'a, A: ToSocketAddrs + Send + 'a>: Future<Output = MfioResult<Self::ListenerHandle>> + 'a
       where Self: 'a;

    // Required methods
    fn connect<'a, A: ToSocketAddrs + Send + 'a>(
        &'a self,
        addrs: A,
    ) -> Self::ConnectFuture<'a, A>;
    fn bind<'a, A: ToSocketAddrs + Send + 'a>(
        &'a self,
        addrs: A,
    ) -> Self::BindFuture<'a, A>;
}
Available on crate feature std only.
Expand description

Describes TCP capable runtime operations.

Required Associated Types§

Source

type StreamHandle: TcpStreamHandle

Source

type ListenerHandle: TcpListenerHandle<StreamHandle = Self::StreamHandle>

Source

type ConnectFuture<'a, A: ToSocketAddrs + Send + 'a>: Future<Output = MfioResult<Self::StreamHandle>> + 'a where Self: 'a

Source

type BindFuture<'a, A: ToSocketAddrs + Send + 'a>: Future<Output = MfioResult<Self::ListenerHandle>> + 'a where Self: 'a

Required Methods§

Source

fn connect<'a, A: ToSocketAddrs + Send + 'a>( &'a self, addrs: A, ) -> Self::ConnectFuture<'a, A>

Source

fn bind<'a, A: ToSocketAddrs + Send + 'a>( &'a self, addrs: A, ) -> Self::BindFuture<'a, A>

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§