pub struct PayloadInformationElement<T: AsRef<[u8]>> { /* private fields */ }Expand description
A reader/writer for the IEEE 802.15.4 Payload Information Elements.
Implementations§
Source§impl<T: AsRef<[u8]>> PayloadInformationElement<T>
impl<T: AsRef<[u8]>> PayloadInformationElement<T>
Sourcepub fn new(data: T) -> Result<Self>
pub fn new(data: T) -> Result<Self>
Create a new PayloadInformationElement reader/writer from a given
buffer.
§Errors
Returns an error if the buffer is too short to contain a payload information element.
Sourcepub fn new_unchecked(data: T) -> Self
pub fn new_unchecked(data: T) -> Self
Create a new PayloadInformationElement reader/writer from a given
buffer without length checking.
Sourcepub fn group_id(&self) -> PayloadGroupId
pub fn group_id(&self) -> PayloadGroupId
Return the PayloadGroupId.
Sourcepub fn nested_information_elements(
&self,
) -> NestedInformationElementsIterator<'_> ⓘ
pub fn nested_information_elements( &self, ) -> NestedInformationElementsIterator<'_> ⓘ
Returns NestedInformationElementsIterator Iterator.
§Panics
This method panics if the PayloadInformationElement is not an
MLME group.
Source§impl<T: AsRef<[u8]> + AsMut<[u8]>> PayloadInformationElement<T>
impl<T: AsRef<[u8]> + AsMut<[u8]>> PayloadInformationElement<T>
Sourcepub fn set_length(&mut self, len: u16)
pub fn set_length(&mut self, len: u16)
Set the length field value.
Sourcepub fn set_group_id(&mut self, id: PayloadGroupId)
pub fn set_group_id(&mut self, id: PayloadGroupId)
Set the PayloadGroupId.
Sourcepub fn content_mut(&mut self) -> &mut [u8]
pub fn content_mut(&mut self) -> &mut [u8]
Return the content of this Header Information Element.
Trait Implementations§
Source§impl<T: PartialEq + AsRef<[u8]>> PartialEq for PayloadInformationElement<T>
impl<T: PartialEq + AsRef<[u8]>> PartialEq for PayloadInformationElement<T>
Source§fn eq(&self, other: &PayloadInformationElement<T>) -> bool
fn eq(&self, other: &PayloadInformationElement<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<T: Eq + AsRef<[u8]>> Eq for PayloadInformationElement<T>
impl<T: AsRef<[u8]>> StructuralPartialEq for PayloadInformationElement<T>
Auto Trait Implementations§
impl<T> Freeze for PayloadInformationElement<T>where
T: Freeze,
impl<T> RefUnwindSafe for PayloadInformationElement<T>where
T: RefUnwindSafe,
impl<T> Send for PayloadInformationElement<T>where
T: Send,
impl<T> Sync for PayloadInformationElement<T>where
T: Sync,
impl<T> Unpin for PayloadInformationElement<T>where
T: Unpin,
impl<T> UnwindSafe for PayloadInformationElement<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