pub struct HeaderInformationElement<T: AsRef<[u8]>> { /* private fields */ }Expand description
A reader/writer for the IEEE 802.15.4 Header Information Elements
Implementations§
Source§impl<T: AsRef<[u8]>> HeaderInformationElement<T>
impl<T: AsRef<[u8]>> HeaderInformationElement<T>
Sourcepub fn new(data: T) -> Result<Self>
pub fn new(data: T) -> Result<Self>
Create a new HeaderInformationElement reader/writer from a given
buffer.
§Errors
Returns an error if the length field is less than 2.
Sourcepub fn new_unchecked(data: T) -> Self
pub fn new_unchecked(data: T) -> Self
Create a new HeaderInformationElement reader/writer from a given
buffer without length checking.
Sourcepub fn element_id(&self) -> HeaderElementId
pub fn element_id(&self) -> HeaderElementId
Return the HeaderElementId.
Source§impl<T: AsRef<[u8]> + AsMut<[u8]>> HeaderInformationElement<T>
impl<T: AsRef<[u8]> + AsMut<[u8]>> HeaderInformationElement<T>
Sourcepub fn set_length(&mut self, len: u16)
pub fn set_length(&mut self, len: u16)
Set the length field.
Sourcepub fn set_element_id(&mut self, id: HeaderElementId)
pub fn set_element_id(&mut self, id: HeaderElementId)
Set the element ID field.
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: Clone + AsRef<[u8]>> Clone for HeaderInformationElement<T>
impl<T: Clone + AsRef<[u8]>> Clone for HeaderInformationElement<T>
Source§fn clone(&self) -> HeaderInformationElement<T>
fn clone(&self) -> HeaderInformationElement<T>
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 moreimpl<T: Copy + AsRef<[u8]>> Copy for HeaderInformationElement<T>
impl<T: Eq + AsRef<[u8]>> Eq for HeaderInformationElement<T>
impl<T: AsRef<[u8]>> StructuralPartialEq for HeaderInformationElement<T>
Auto Trait Implementations§
impl<T> Freeze for HeaderInformationElement<T>where
T: Freeze,
impl<T> RefUnwindSafe for HeaderInformationElement<T>where
T: RefUnwindSafe,
impl<T> Send for HeaderInformationElement<T>where
T: Send,
impl<T> Sync for HeaderInformationElement<T>where
T: Sync,
impl<T> Unpin for HeaderInformationElement<T>where
T: Unpin,
impl<T> UnwindSafe for HeaderInformationElement<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