[][src]Struct tokio::net::udp::RecvHalf

pub struct RecvHalf(_);
This is supported on feature="udp" only.

The recv half after split.

Use recv_from or recv to receive datagrams.

Implementations

impl RecvHalf[src]

pub fn reunite(self, other: SendHalf) -> Result<UdpSocket, ReuniteError>[src]

This is supported on feature="udp" only.

Attempts to put the two "halves" of a UdpSocket back together and recover the original socket. Succeeds only if the two "halves" originated from the same call to UdpSocket::split.

pub async fn recv_from<'_, '_>(
    &'_ mut self,
    buf: &'_ mut [u8]
) -> Result<(usize, SocketAddr)>
[src]

This is supported on feature="udp" only.

Returns a future that receives a single datagram on the socket. On success, the future resolves to the number of bytes read and the origin.

The function must be called with valid byte array buf of sufficient size to hold the message bytes. If a message is too long to fit in the supplied buffer, excess bytes may be discarded.

pub async fn recv<'_, '_>(&'_ mut self, buf: &'_ mut [u8]) -> Result<usize>[src]

This is supported on feature="udp" only.

Returns a future that receives a single datagram message on the socket from the remote address to which it is connected. On success, the future will resolve to the number of bytes read.

The function must be called with valid byte array buf of sufficient size to hold the message bytes. If a message is too long to fit in the supplied buffer, excess bytes may be discarded.

The connect method will connect this socket to a remote address. The future will fail if the socket is not connected.

Trait Implementations

impl AsRef<UdpSocket> for RecvHalf[src]

impl Debug for RecvHalf[src]

Auto Trait Implementations

impl !RefUnwindSafe for RecvHalf

impl Send for RecvHalf

impl Sync for RecvHalf

impl Unpin for RecvHalf

impl !UnwindSafe for RecvHalf

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.