pub trait IPeer: Sync + Send {
// Required methods
fn addr(&self) -> SocketAddr;
fn is_disconnect(&self) -> impl Future<Output = Result<bool>>;
fn send<B: Deref<Target = [u8]> + Send + Sync + 'static>(
&self,
buff: B,
) -> impl Future<Output = Result<usize>>;
fn send_all<B: Deref<Target = [u8]> + Send + Sync + 'static>(
&self,
buff: B,
) -> impl Future<Output = Result<()>>;
fn send_ref(&self, buff: &[u8]) -> impl Future<Output = Result<usize>>;
fn send_all_ref(&self, buff: &[u8]) -> impl Future<Output = Result<()>>;
fn flush(&self) -> impl Future<Output = Result<()>>;
fn disconnect(&self) -> impl Future<Output = Result<()>>;
}Required Methods§
fn addr(&self) -> SocketAddr
fn is_disconnect(&self) -> impl Future<Output = Result<bool>>
fn send<B: Deref<Target = [u8]> + Send + Sync + 'static>( &self, buff: B, ) -> impl Future<Output = Result<usize>>
fn send_all<B: Deref<Target = [u8]> + Send + Sync + 'static>( &self, buff: B, ) -> impl Future<Output = Result<()>>
fn send_ref(&self, buff: &[u8]) -> impl Future<Output = Result<usize>>
fn send_all_ref(&self, buff: &[u8]) -> impl Future<Output = Result<()>>
fn flush(&self) -> impl Future<Output = Result<()>>
fn disconnect(&self) -> impl Future<Output = Result<()>>
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.