Struct netlink_packet_netfilter::nla::NlaBuffer
source · [−]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,
sourcepub fn parse(buf: &NlaBuffer<&'buffer T>) -> Result<DefaultNla, DecodeError>
pub fn parse(buf: &NlaBuffer<&'buffer T>) -> Result<DefaultNla, 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 · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more