pub trait TransportProtocol {
type Stream: AsyncReadExt + AsyncWriteExt + Unpin;
// Required method
fn connect(&self) -> impl Future<Output = Result<Self::Stream>>;
}Expand description
The communication protocol to use
Required Associated Types§
Sourcetype Stream: AsyncReadExt + AsyncWriteExt + Unpin
type Stream: AsyncReadExt + AsyncWriteExt + Unpin
Bidirectional stream
Required Methods§
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.
Implementations on Foreign Types§
Source§impl<T: TransportProtocol> TransportProtocol for &T
impl<T: TransportProtocol> TransportProtocol for &T
Implementors§
Source§impl<A: AsyncToSocketAddrs> TransportProtocol for Tcp<A>
impl<A: AsyncToSocketAddrs> TransportProtocol for Tcp<A>
Source§impl<P: AsRef<Path>> TransportProtocol for Socket<P>
Available on Unix only.
impl<P: AsRef<Path>> TransportProtocol for Socket<P>
Available on Unix only.