pub trait IPeer: Sync + Send {
// Required methods
fn addr(&self) -> SocketAddr;
fn is_disconnect(&self) -> impl Future<Output = Result<bool>>;
fn send_message(&self, message: Message) -> impl Future<Output = Result<()>>;
fn send(&self, buff: Vec<u8>) -> impl Future<Output = Result<usize>>;
fn send_all(&self, buff: Vec<u8>) -> 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_message(&self, message: Message) -> impl Future<Output = Result<()>>
fn send(&self, buff: Vec<u8>) -> impl Future<Output = Result<usize>>
fn send_all(&self, buff: Vec<u8>) -> 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.