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§
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>
Object Safety§
This trait is not object safe.
Implementors§
source§impl Tcp for NativeRtInstance
Available on crate feature native
only.
impl Tcp for NativeRtInstance
Available on crate feature
native
only.type StreamHandle = NativeTcpStream
type ListenerHandle = NativeTcpListener
type ConnectFuture<'a, A: ToSocketAddrs + Send + 'a> = NativeTcpConnectFuture<'a, A>
type BindFuture<'a, A: ToSocketAddrs + Send + 'a> = Ready<Result<NativeTcpListener, Error>>
source§impl Tcp for NativeRt
Available on crate feature native
only.
impl Tcp for NativeRt
Available on crate feature
native
only.