[−][src]Trait async_datagram::AsyncDatagram
Implement a datagram protocol.
Associated Types
type Target
Specifies which target to send the data to.
type Err
The type of failures yielded by this trait.
Required methods
fn poll_send_to(
&mut self,
waker: &Waker,
buf: &[u8],
target: impl AsRef<Self::Target>
) -> Poll<Result<usize, Self::Err>>
&mut self,
waker: &Waker,
buf: &[u8],
target: impl AsRef<Self::Target>
) -> Poll<Result<usize, Self::Err>>
Sends data on the IO interface to the specified target.
On success, returns the number of bytes written.
fn poll_recv_from(
&mut self,
waker: &Waker,
buf: &mut [u8]
) -> Poll<Result<(usize, Self::Target), Self::Err>>
&mut self,
waker: &Waker,
buf: &mut [u8]
) -> Poll<Result<(usize, Self::Target), Self::Err>>
Receives data from the IO interface.
On success, returns the number of bytes read and the target from whence the data came.