pub struct NlaBuffer<T: AsRef<[u8]>> { /* private fields */ }
Implementations§
Source§impl<T: AsRef<[u8]>> NlaBuffer<T>
impl<T: AsRef<[u8]>> NlaBuffer<T>
pub fn new(buffer: T) -> NlaBuffer<T>
pub fn new_checked(buffer: T) -> Result<NlaBuffer<T>, NlaError>
pub fn check_buffer_length(&self) -> Result<(), NlaError>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume the buffer, returning the underlying buffer.
pub fn nested_flag(&self) -> bool
pub fn network_byte_order_flag(&self) -> bool
Sourcepub fn length(&self) -> u16
pub fn length(&self) -> u16
Return the length
field. The length
field corresponds to the length
of the nla header (type and length fields, and the value field).
However, it does not account for the potential padding that follows
the value field.
Sourcepub fn value_length(&self) -> usize
pub fn value_length(&self) -> usize
Return the length of the value
field
§Panic
This panics if the length field value is less than the attribut header size.
Source§impl<T: AsRef<[u8]> + AsMut<[u8]>> NlaBuffer<T>
impl<T: AsRef<[u8]> + AsMut<[u8]>> NlaBuffer<T>
pub fn set_nested_flag(&mut self)
pub fn set_network_byte_order_flag(&mut self)
Sourcepub fn set_length(&mut self, length: u16)
pub fn set_length(&mut self, length: u16)
Set the length
field
Trait Implementations§
Source§impl<'buffer, T: AsRef<[u8]> + ?Sized> Parseable<NlaBuffer<&'buffer T>> for DefaultNla
impl<'buffer, T: AsRef<[u8]> + ?Sized> Parseable<NlaBuffer<&'buffer T>> for DefaultNla
impl<T: Copy + AsRef<[u8]>> Copy for NlaBuffer<T>
impl<T: Eq + AsRef<[u8]>> Eq for NlaBuffer<T>
impl<T: AsRef<[u8]>> StructuralPartialEq for NlaBuffer<T>
Auto Trait Implementations§
impl<T> Freeze for NlaBuffer<T>where
T: Freeze,
impl<T> RefUnwindSafe for NlaBuffer<T>where
T: RefUnwindSafe,
impl<T> Send for NlaBuffer<T>where
T: Send,
impl<T> Sync for NlaBuffer<T>where
T: Sync,
impl<T> Unpin for NlaBuffer<T>where
T: Unpin,
impl<T> UnwindSafe for NlaBuffer<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)