Struct smoltcp::wire::SixlowpanIphcPacket
source · Expand description
A read/write wrapper around a LOWPAN_IPHC frame buffer.
Implementations§
source§impl<T: AsRef<[u8]>> Packet<T>
impl<T: AsRef<[u8]>> Packet<T>
sourcepub fn new_unchecked(buffer: T) -> Packet<T>
pub fn new_unchecked(buffer: T) -> Packet<T>
Input a raw octet buffer with a 6LoWPAN_IPHC frame structure.
sourcepub fn new_checked(buffer: T) -> Result<Packet<T>>
pub fn new_checked(buffer: T) -> Result<Packet<T>>
Shorthand for a combination of new_unchecked and check_len.
sourcepub fn check_len(&self) -> Result<()>
pub fn check_len(&self) -> Result<()>
Ensure that no accessor method will panic if called.
Returns Err(Error::Truncated)
if the buffer is too short.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the frame, returning the underlying buffer.
sourcepub fn next_header(&self) -> NextHeader
pub fn next_header(&self) -> NextHeader
Return the Next Header field of this IPHC packet.
sourcepub fn src_context_id(&self) -> Option<u8>
pub fn src_context_id(&self) -> Option<u8>
Return the Source Context Identifier of this IPHC packet.
sourcepub fn dst_context_id(&self) -> Option<u8>
pub fn dst_context_id(&self) -> Option<u8>
Return the Destination Context Identifier of this IPHC packet.