pub trait Transport: Send + Sync {
// Required methods
fn connect(&mut self) -> impl Future<Output = Result<()>> + Send;
fn read(
&mut self,
buf: &mut [u8],
) -> impl Future<Output = Result<usize>> + Send;
fn write(&mut self, buf: &[u8]) -> impl Future<Output = Result<()>> + Send;
fn close(&mut self) -> impl Future<Output = Result<()>> + Send;
// Provided method
fn is_connected(&self) -> bool { ... }
}Required Methods§
Provided Methods§
Sourcefn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Checks if the transport is connected
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.