Trait tsproto::connection::Socket[][src]

pub trait Socket {
    fn poll_recv_from(
        &self,
        cx: &mut Context<'_>,
        buf: &mut ReadBuf<'_>
    ) -> Poll<Result<SocketAddr>>;
fn poll_send_to(
        &self,
        cx: &mut Context<'_>,
        buf: &[u8],
        target: SocketAddr
    ) -> Poll<Result<usize>>;
fn local_addr(&self) -> Result<SocketAddr>; }
Expand description

The needed functions, this can be used to abstract from the underlying transport and allows simulation.

Required methods

fn poll_recv_from(
    &self,
    cx: &mut Context<'_>,
    buf: &mut ReadBuf<'_>
) -> Poll<Result<SocketAddr>>
[src]

fn poll_send_to(
    &self,
    cx: &mut Context<'_>,
    buf: &[u8],
    target: SocketAddr
) -> Poll<Result<usize>>
[src]

fn local_addr(&self) -> Result<SocketAddr>[src]

Loading content...

Implementations on Foreign Types

impl Socket for UdpSocket[src]

fn poll_recv_from(
    &self,
    cx: &mut Context<'_>,
    buf: &mut ReadBuf<'_>
) -> Poll<Result<SocketAddr>>
[src]

fn poll_send_to(
    &self,
    cx: &mut Context<'_>,
    buf: &[u8],
    target: SocketAddr
) -> Poll<Result<usize>>
[src]

fn local_addr(&self) -> Result<SocketAddr>[src]

Loading content...

Implementors

Loading content...