Struct smoltcp::wire::UdpPacket [−][src]
Expand description
A read/write wrapper around an User Datagram Protocol packet buffer.
Implementations
Imbue a raw octet buffer with UDP packet structure.
Shorthand for a combination of new_unchecked and check_len.
Ensure that no accessor method will panic if called.
Returns Err(Error::Truncated)
if the buffer is too short.
Returns Err(Error::Malformed)
if the length field has a value smaller
than the header length.
The result of this check is invalidated by calling set_len.
Consume the packet, returning the underlying buffer.
Set the source port field.
Set the destination port field.
Set the checksum field.
Compute and fill in the header checksum.
Panics
This function panics unless src_addr
and dst_addr
belong to the same family,
and that family is IPv4 or IPv6.
Trait Implementations
fn pretty_print(
buffer: &dyn AsRef<[u8]>,
f: &mut Formatter<'_>,
indent: &mut PrettyIndent
) -> Result
fn pretty_print(
buffer: &dyn AsRef<[u8]>,
f: &mut Formatter<'_>,
indent: &mut PrettyIndent
) -> Result
Write a concise, formatted representation of a packet contained in the provided buffer, and any nested packets it may contain. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Packet<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Packet<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more