pub struct RecvHalf(_);
Implementations
sourceimpl RecvHalf
impl RecvHalf
sourcepub fn reunite(self, other: SendHalf) -> Result<UdpSocket, ReuniteError>
pub fn reunite(self, other: SendHalf) -> Result<UdpSocket, ReuniteError>
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
.
sourcepub async fn recv_from(&mut self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
pub async fn recv_from(&mut self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
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.
sourcepub async fn recv(&mut self, buf: &mut [u8]) -> Result<usize>
pub async fn recv(&mut self, buf: &mut [u8]) -> Result<usize>
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
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more