Skip to main content

IPeer

Trait IPeer 

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

Source

fn addr(&self) -> SocketAddr

Source

fn is_disconnect(&self) -> impl Future<Output = Result<bool>>

Source

fn send_message(&self, message: Message) -> impl Future<Output = Result<()>>

Source

fn send(&self, buff: Vec<u8>) -> impl Future<Output = Result<usize>>

Source

fn send_all(&self, buff: Vec<u8>) -> impl Future<Output = Result<()>>

Source

fn send_ref(&self, buff: &[u8]) -> impl Future<Output = Result<usize>>

Source

fn send_all_ref(&self, buff: &[u8]) -> impl Future<Output = Result<()>>

Source

fn flush(&self) -> impl Future<Output = Result<()>>

Source

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

Implementations on Foreign Types§

Source§

impl IPeer for Actor<WSPeer>

Source§

fn addr(&self) -> SocketAddr

Source§

async fn is_disconnect(&self) -> Result<bool>

Source§

async fn send_message(&self, message: Message) -> Result<()>

Source§

async fn send(&self, buff: Vec<u8>) -> Result<usize>

Source§

async fn send_all(&self, buff: Vec<u8>) -> Result<()>

Source§

async fn send_ref(&self, buff: &[u8]) -> Result<usize>

Source§

async fn send_all_ref(&self, buff: &[u8]) -> Result<()>

Source§

async fn flush(&self) -> Result<()>

Source§

async fn disconnect(&self) -> Result<()>

Implementors§