[][src]Trait async_coap::datagram::AsyncSendTo

pub trait AsyncSendTo: DatagramSocketTypes {
    fn poll_send_to<B>(
        self: Pin<&Self>,
        cx: &mut Context,
        buf: &[u8],
        addr: B
    ) -> Poll<Result<usize, Self::Error>>
    where
        B: ToSocketAddrs<SocketAddr = Self::SocketAddr, Error = Self::Error>
; fn next_send_to<'a, 'b, B>(
        &'a self,
        buf: &'b [u8],
        addr: B
    ) -> NextSendToFuture<'a, 'b, Self>
    where
        B: ToSocketAddrs<SocketAddr = Self::SocketAddr, Error = Self::Error>
, { ... }
fn send_to<B>(&self, buf: &[u8], addr: B) -> Result<usize, Self::Error>
    where
        B: ToSocketAddrs<SocketAddr = Self::SocketAddr, Error = Self::Error>
, { ... } }

Trait for providing sent_to functionality for asynchronous, datagram-based sockets.

Required methods

fn poll_send_to<B>(
    self: Pin<&Self>,
    cx: &mut Context,
    buf: &[u8],
    addr: B
) -> Poll<Result<usize, Self::Error>> where
    B: ToSocketAddrs<SocketAddr = Self::SocketAddr, Error = Self::Error>, 

A non-blocking1, poll_* version of std::net::UdpSocket::send_to.


  1. Note that while the spirit of this method intends for it to be non-blocking, AllowStdUdpSocket can block execution depending on the implementation details of the underlying std::net::UdpSocket

Loading content...

Provided methods

Important traits for NextSendToFuture<'a, 'b, T>
fn next_send_to<'a, 'b, B>(
    &'a self,
    buf: &'b [u8],
    addr: B
) -> NextSendToFuture<'a, 'b, Self> where
    B: ToSocketAddrs<SocketAddr = Self::SocketAddr, Error = Self::Error>, 

Returns a future that uses AsyncSendTo::poll_send_to.

fn send_to<B>(&self, buf: &[u8], addr: B) -> Result<usize, Self::Error> where
    B: ToSocketAddrs<SocketAddr = Self::SocketAddr, Error = Self::Error>, 

A synchronous version of AsyncSendTo::poll_send_to. If this isn't overridden by the trait's implementation, the default version will call poll_send_to() and panics if it returns Poll::Pending.

Loading content...

Implementors

impl AsyncSendTo for AllowStdUdpSocket[src]

impl AsyncSendTo for LoopbackSocket[src]

impl AsyncSendTo for NullSocket[src]

Loading content...