Implementations
sourceimpl<T> NlaBuffer<T> where
T: AsRef<[u8]>,
impl<T> NlaBuffer<T> where
T: AsRef<[u8]>,
pub fn new(buffer: T) -> NlaBuffer<T>
pub fn new_checked(buffer: T) -> Result<NlaBuffer<T>, DecodeError>
pub fn check_buffer_length(&self) -> Result<(), DecodeError>
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.
sourceimpl<T> NlaBuffer<T> where
T: AsRef<[u8]> + AsMut<[u8]>,
impl<T> NlaBuffer<T> where
T: AsRef<[u8]> + AsMut<[u8]>,
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
sourceimpl<'buffer, T> Parseable<NlaBuffer<&'buffer T>> for DefaultNla where
T: AsRef<[u8]> + ?Sized,
impl<'buffer, T> Parseable<NlaBuffer<&'buffer T>> for DefaultNla where
T: AsRef<[u8]> + ?Sized,
sourcefn parse(buf: &NlaBuffer<&'buffer T>) -> Result<DefaultNla, DecodeError>
fn parse(buf: &NlaBuffer<&'buffer T>) -> Result<DefaultNla, DecodeError>
Deserialize the current type.
sourceimpl<'a, T, S> ParseableParametrized<NlaBuffer<&'a T>, S> for ActOpt where
T: AsRef<[u8]> + ?Sized,
S: AsRef<str>,
impl<'a, T, S> ParseableParametrized<NlaBuffer<&'a T>, S> for ActOpt where
T: AsRef<[u8]> + ?Sized,
S: AsRef<str>,
sourcefn parse_with_param(buf: &NlaBuffer<&'a T>, kind: S) -> Result<Self, DecodeError>
fn parse_with_param(buf: &NlaBuffer<&'a T>, kind: S) -> Result<Self, DecodeError>
Deserialize the current type.
sourceimpl<'a, T, S> ParseableParametrized<NlaBuffer<&'a T>, S> for TcOpt where
T: AsRef<[u8]> + ?Sized,
S: AsRef<str>,
impl<'a, T, S> ParseableParametrized<NlaBuffer<&'a T>, S> for TcOpt where
T: AsRef<[u8]> + ?Sized,
S: AsRef<str>,
sourcefn parse_with_param(buf: &NlaBuffer<&'a T>, kind: S) -> Result<Self, DecodeError>
fn parse_with_param(buf: &NlaBuffer<&'a T>, kind: S) -> Result<Self, DecodeError>
Deserialize the current type.
sourceimpl<'a, T: AsRef<[u8]> + ?Sized> ParseableParametrized<NlaBuffer<&'a T>, u16> for Nla
impl<'a, T: AsRef<[u8]> + ?Sized> ParseableParametrized<NlaBuffer<&'a T>, u16> for Nla
sourcefn parse_with_param(
buf: &NlaBuffer<&'a T>,
interface_family: u16
) -> Result<Self, DecodeError>
fn parse_with_param(
buf: &NlaBuffer<&'a T>,
interface_family: u16
) -> Result<Self, DecodeError>
Deserialize the current type.
impl<T> Copy for NlaBuffer<T> where
T: Copy + AsRef<[u8]>,
impl<T> Eq for NlaBuffer<T> where
T: Eq + AsRef<[u8]>,
impl<T> StructuralEq for NlaBuffer<T> where
T: AsRef<[u8]>,
impl<T> StructuralPartialEq for NlaBuffer<T> where
T: AsRef<[u8]>,
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more