pub struct NestedInformationElement<T: AsRef<[u8]>> { /* private fields */ }
Expand description
A reader/writer for the IEEE 802.15.4 Nested Information Elements.
§Short format
+--------+--------+--------+--------------------------+
| Length | Sub-ID | Type=0 | Content (0-255 octets)...|
+--------+--------+--------+--------------------------+
§Long format
+--------+--------+--------+---------------------------+
| Length | Sub-ID | Type=1 | Content (0-2046 octets)...|
+--------+--------+--------+---------------------------+
Implementations§
Source§impl<T: AsRef<[u8]>> NestedInformationElement<T>
impl<T: AsRef<[u8]>> NestedInformationElement<T>
Sourcepub fn new(data: T) -> Result<Self>
pub fn new(data: T) -> Result<Self>
Create a new NestedInformationElement
reader/writer from a given
buffer.
§Errors
Returns an error if the buffer is too short to contain the nested information element.
Sourcepub fn new_unchecked(data: T) -> Self
pub fn new_unchecked(data: T) -> Self
Create a new NestedInformationElement
reader/writer from a given
buffer without length checking.
Sourcepub fn sub_id(&self) -> NestedSubId
pub fn sub_id(&self) -> NestedSubId
Return the NestedSubId
.
Source§impl<T: AsRef<[u8]> + AsMut<[u8]>> NestedInformationElement<T>
impl<T: AsRef<[u8]> + AsMut<[u8]>> NestedInformationElement<T>
Sourcepub fn set_length(&mut self, len: u16, id: NestedSubId)
pub fn set_length(&mut self, len: u16, id: NestedSubId)
Set the length of the Nested Information Element.
Sourcepub fn set_sub_id(&mut self, id: NestedSubId)
pub fn set_sub_id(&mut self, id: NestedSubId)
Set the NestedSubId
.
Sourcepub fn content_mut(&mut self) -> &mut [u8]
pub fn content_mut(&mut self) -> &mut [u8]
Return a mutable reference to the content of this Nested Information
Trait Implementations§
Source§impl<T: Clone + AsRef<[u8]>> Clone for NestedInformationElement<T>
impl<T: Clone + AsRef<[u8]>> Clone for NestedInformationElement<T>
Source§fn clone(&self) -> NestedInformationElement<T>
fn clone(&self) -> NestedInformationElement<T>
Returns a duplicate 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 moreimpl<T: Copy + AsRef<[u8]>> Copy for NestedInformationElement<T>
impl<T: Eq + AsRef<[u8]>> Eq for NestedInformationElement<T>
impl<T: AsRef<[u8]>> StructuralPartialEq for NestedInformationElement<T>
Auto Trait Implementations§
impl<T> Freeze for NestedInformationElement<T>where
T: Freeze,
impl<T> RefUnwindSafe for NestedInformationElement<T>where
T: RefUnwindSafe,
impl<T> Send for NestedInformationElement<T>where
T: Send,
impl<T> Sync for NestedInformationElement<T>where
T: Sync,
impl<T> Unpin for NestedInformationElement<T>where
T: Unpin,
impl<T> UnwindSafe for NestedInformationElement<T>where
T: UnwindSafe,
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