Struct smoltcp::wire::SixlowpanUdpNhcRepr
source · pub struct SixlowpanUdpNhcRepr(pub UdpRepr);
Expand description
A high-level representation of a 6LoWPAN NHC UDP header.
Tuple Fields§
§0: UdpRepr
Implementations§
source§impl<'a> UdpNhcRepr
impl<'a> UdpNhcRepr
sourcepub fn parse<T: AsRef<[u8]> + ?Sized>(
packet: &UdpNhcPacket<&'a T>,
src_addr: &Address,
dst_addr: &Address,
checksum_caps: &ChecksumCapabilities
) -> Result<Self>
pub fn parse<T: AsRef<[u8]> + ?Sized>(
packet: &UdpNhcPacket<&'a T>,
src_addr: &Address,
dst_addr: &Address,
checksum_caps: &ChecksumCapabilities
) -> Result<Self>
Parse a 6LoWPAN NHC UDP packet and return a high-level representation.
sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Return the length of a packet that will be emitted from this high-level representation.
Methods from Deref<Target = UdpRepr>§
sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Return the length of the packet header that will be emitted from this high-level representation.
sourcepub fn emit<T>(
&self,
packet: &mut Packet<&mut T>,
src_addr: &IpAddress,
dst_addr: &IpAddress,
payload_len: usize,
emit_payload: impl FnOnce(&mut [u8]),
checksum_caps: &ChecksumCapabilities
)where
T: AsRef<[u8]> + AsMut<[u8]> + ?Sized,
pub fn emit<T>(
&self,
packet: &mut Packet<&mut T>,
src_addr: &IpAddress,
dst_addr: &IpAddress,
payload_len: usize,
emit_payload: impl FnOnce(&mut [u8]),
checksum_caps: &ChecksumCapabilities
)where
T: AsRef<[u8]> + AsMut<[u8]> + ?Sized,
Emit a high-level representation into an User Datagram Protocol packet.
Trait Implementations§
source§impl Clone for UdpNhcRepr
impl Clone for UdpNhcRepr
source§fn clone(&self) -> UdpNhcRepr
fn clone(&self) -> UdpNhcRepr
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for UdpNhcRepr
impl Debug for UdpNhcRepr
source§impl Deref for UdpNhcRepr
impl Deref for UdpNhcRepr
source§impl DerefMut for UdpNhcRepr
impl DerefMut for UdpNhcRepr
source§impl PartialEq<UdpNhcRepr> for UdpNhcRepr
impl PartialEq<UdpNhcRepr> for UdpNhcRepr
source§fn eq(&self, other: &UdpNhcRepr) -> bool
fn eq(&self, other: &UdpNhcRepr) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.