PacketIO

Trait PacketIO 

Source
pub trait PacketIO:
    Send
    + Sync
    + 'static {
    // Required methods
    fn send_to(
        &self,
        buf: &[u8],
        target: SocketAddr,
    ) -> impl Future<Output = Result<usize>> + Sync + Send;
    fn recv_from(
        &self,
        buf: &mut [u8],
    ) -> impl Future<Output = Result<(usize, SocketAddr)>> + Sync + Send;
}

Required Methods§

Source

fn send_to( &self, buf: &[u8], target: SocketAddr, ) -> impl Future<Output = Result<usize>> + Sync + Send

Source

fn recv_from( &self, buf: &mut [u8], ) -> impl Future<Output = Result<(usize, SocketAddr)>> + Sync + Send

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 PacketIO for UdpSocket

Source§

fn send_to( &self, buf: &[u8], target: SocketAddr, ) -> impl Future<Output = Result<usize>> + Sync

Source§

fn recv_from( &self, buf: &mut [u8], ) -> impl Future<Output = Result<(usize, SocketAddr)>> + Sync

Implementors§