[][src]Struct netlink_packet_utils::nla::NlaBuffer

pub struct NlaBuffer<T: AsRef<[u8]>> { /* fields omitted */ }

Implementations

impl<T: AsRef<[u8]>> NlaBuffer<T>[src]

pub fn new(buffer: T) -> NlaBuffer<T>[src]

pub fn new_checked(buffer: T) -> Result<NlaBuffer<T>, DecodeError>[src]

pub fn check_buffer_length(&self) -> Result<(), DecodeError>[src]

pub fn into_inner(self) -> T[src]

Consume the buffer, returning the underlying buffer.

pub fn inner(&mut self) -> &T[src]

Return a reference to the underlying buffer

pub fn inner_mut(&mut self) -> &mut T[src]

Return a mutable reference to the underlying buffer

pub fn kind(&self) -> u16[src]

Return the type field

pub fn nested_flag(&self) -> bool[src]

pub fn network_byte_order_flag(&self) -> bool[src]

pub fn length(&self) -> u16[src]

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.

pub fn value_length(&self) -> usize[src]

Return the length of the value field

Panic

This panics if the length field value is less than the attribut header size.

impl<T: AsRef<[u8]> + AsMut<[u8]>> NlaBuffer<T>[src]

pub fn set_kind(&mut self, kind: u16)[src]

Set the type field

pub fn set_nested_flag(&mut self)[src]

pub fn set_network_byte_order_flag(&mut self)[src]

pub fn set_length(&mut self, length: u16)[src]

Set the length field

impl<'buffer, T: AsRef<[u8]> + ?Sized> NlaBuffer<&'buffer T>[src]

pub fn value(&self) -> &[u8][src]

Return the value field

impl<'buffer, T: AsRef<[u8]> + AsMut<[u8]> + ?Sized> NlaBuffer<&'buffer mut T>[src]

pub fn value_mut(&mut self) -> &mut [u8][src]

Return the value field

Trait Implementations

impl<T: Clone + AsRef<[u8]>> Clone for NlaBuffer<T>[src]

impl<T: Copy + AsRef<[u8]>> Copy for NlaBuffer<T>[src]

impl<T: Debug + AsRef<[u8]>> Debug for NlaBuffer<T>[src]

impl<T: Eq + AsRef<[u8]>> Eq for NlaBuffer<T>[src]

impl<'buffer, T: AsRef<[u8]> + ?Sized> Parseable<NlaBuffer<&'buffer T>> for DefaultNla[src]

impl<T: PartialEq + AsRef<[u8]>> PartialEq<NlaBuffer<T>> for NlaBuffer<T>[src]

impl<T: AsRef<[u8]>> StructuralEq for NlaBuffer<T>[src]

impl<T: AsRef<[u8]>> StructuralPartialEq for NlaBuffer<T>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.