pub enum RecvError {
InvalidState,
Exhausted,
Truncated,
IcmpError {
error: IcmpError,
remote: IpEndpoint,
},
}Expand description
Error returned by UdpSocket::recv and the peek methods.
Variants§
InvalidState
The socket is not bound.
Exhausted
The RX queue is empty.
Truncated
The provided slice is smaller than the payload. (The packet is dropped by
recv_slice, but not by peek_slice.)
IcmpError
An ICMP error message quoting a packet this socket sent has arrived
(reported once, taking it clears it). See
take_icmp_error.
Fields
§
remote: IpEndpointThe remote endpoint the erring packet was sent to.
Trait Implementations§
impl Copy for RecvError
impl Eq for RecvError
Source§impl Error for RecvError
impl Error for RecvError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for RecvError
Auto Trait Implementations§
impl Freeze for RecvError
impl RefUnwindSafe for RecvError
impl Send for RecvError
impl Sync for RecvError
impl Unpin for RecvError
impl UnsafeUnpin for RecvError
impl UnwindSafe for RecvError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more