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>
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§
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.