Skip to main content

NvList

Struct NvList 

Source
pub struct NvList { /* private fields */ }

Implementations§

Source§

impl NvList

Source

pub fn insert_i8<'a, N: IntoCStr<'a>>( &mut self, name: N, value: i8, ) -> NvResult<()>

Add $type_ value to the list.

Source

pub fn get_i8<'a, N: IntoCStr<'a>>(&self, name: N) -> NvResult<i8>

Get a $type_ value by given name from the list.

Source

pub fn insert_u8<'a, N: IntoCStr<'a>>( &mut self, name: N, value: u8, ) -> NvResult<()>

Add $type_ value to the list.

Source

pub fn get_u8<'a, N: IntoCStr<'a>>(&self, name: N) -> NvResult<u8>

Get a $type_ value by given name from the list.

Source

pub fn insert_i16<'a, N: IntoCStr<'a>>( &mut self, name: N, value: i16, ) -> NvResult<()>

Add $type_ value to the list.

Source

pub fn get_i16<'a, N: IntoCStr<'a>>(&self, name: N) -> NvResult<i16>

Get a $type_ value by given name from the list.

Source

pub fn insert_u16<'a, N: IntoCStr<'a>>( &mut self, name: N, value: u16, ) -> NvResult<()>

Add $type_ value to the list.

Source

pub fn get_u16<'a, N: IntoCStr<'a>>(&self, name: N) -> NvResult<u16>

Get a $type_ value by given name from the list.

Source

pub fn insert_i32<'a, N: IntoCStr<'a>>( &mut self, name: N, value: i32, ) -> NvResult<()>

Add $type_ value to the list.

Source

pub fn get_i32<'a, N: IntoCStr<'a>>(&self, name: N) -> NvResult<i32>

Get a $type_ value by given name from the list.

Source

pub fn insert_u32<'a, N: IntoCStr<'a>>( &mut self, name: N, value: u32, ) -> NvResult<()>

Add $type_ value to the list.

Source

pub fn get_u32<'a, N: IntoCStr<'a>>(&self, name: N) -> NvResult<u32>

Get a $type_ value by given name from the list.

Source

pub fn insert_i64<'a, N: IntoCStr<'a>>( &mut self, name: N, value: i64, ) -> NvResult<()>

Add $type_ value to the list.

Source

pub fn get_i64<'a, N: IntoCStr<'a>>(&self, name: N) -> NvResult<i64>

Get a $type_ value by given name from the list.

Source

pub fn insert_u64<'a, N: IntoCStr<'a>>( &mut self, name: N, value: u64, ) -> NvResult<()>

Add $type_ value to the list.

Source

pub fn get_u64<'a, N: IntoCStr<'a>>(&self, name: N) -> NvResult<u64>

Get a $type_ value by given name from the list.

Source

pub fn insert_i8_array<'a, N: IntoCStr<'a>>( &mut self, name: N, value: &mut [i8], ) -> NvResult<()>

Add &[$type_] value to the list.

Source

pub fn get_i8_array<'a, 'b, N: IntoCStr<'b>>( &'a self, name: N, ) -> NvResult<&'a [i8]>

Get a $type_ value by given name from the list.

Source

pub fn insert_u8_array<'a, N: IntoCStr<'a>>( &mut self, name: N, value: &mut [u8], ) -> NvResult<()>

Add &[$type_] value to the list.

Source

pub fn get_u8_array<'a, 'b, N: IntoCStr<'b>>( &'a self, name: N, ) -> NvResult<&'a [u8]>

Get a $type_ value by given name from the list.

Source

pub fn insert_i16_array<'a, N: IntoCStr<'a>>( &mut self, name: N, value: &mut [i16], ) -> NvResult<()>

Add &[$type_] value to the list.

Source

pub fn get_i16_array<'a, 'b, N: IntoCStr<'b>>( &'a self, name: N, ) -> NvResult<&'a [i16]>

Get a $type_ value by given name from the list.

Source

pub fn insert_u16_array<'a, N: IntoCStr<'a>>( &mut self, name: N, value: &mut [u16], ) -> NvResult<()>

Add &[$type_] value to the list.

Source

pub fn get_u16_array<'a, 'b, N: IntoCStr<'b>>( &'a self, name: N, ) -> NvResult<&'a [u16]>

Get a $type_ value by given name from the list.

Source

pub fn insert_i32_array<'a, N: IntoCStr<'a>>( &mut self, name: N, value: &mut [i32], ) -> NvResult<()>

Add &[$type_] value to the list.

Source

pub fn get_i32_array<'a, 'b, N: IntoCStr<'b>>( &'a self, name: N, ) -> NvResult<&'a [i32]>

Get a $type_ value by given name from the list.

Source

pub fn insert_u32_array<'a, N: IntoCStr<'a>>( &mut self, name: N, value: &mut [u32], ) -> NvResult<()>

Add &[$type_] value to the list.

Source

pub fn get_u32_array<'a, 'b, N: IntoCStr<'b>>( &'a self, name: N, ) -> NvResult<&'a [u32]>

Get a $type_ value by given name from the list.

Source

pub fn insert_i64_array<'a, N: IntoCStr<'a>>( &mut self, name: N, value: &mut [i64], ) -> NvResult<()>

Add &[$type_] value to the list.

Source

pub fn get_i64_array<'a, 'b, N: IntoCStr<'b>>( &'a self, name: N, ) -> NvResult<&'a [i64]>

Get a $type_ value by given name from the list.

Source

pub fn insert_u64_array<'a, N: IntoCStr<'a>>( &mut self, name: N, value: &mut [u64], ) -> NvResult<()>

Add &[$type_] value to the list.

Source

pub fn get_u64_array<'a, 'b, N: IntoCStr<'b>>( &'a self, name: N, ) -> NvResult<&'a [u64]>

Get a $type_ value by given name from the list.

Source

pub fn as_ptr(&self) -> *mut nvlist_t

Make a copy of a pointer. Danger zone.

Source

pub fn new(flags: NvFlag) -> NvResult<Self>

Source

pub unsafe fn from_ptr(ptr: *mut nvlist_t) -> Self

Source

pub fn iter(&self) -> impl Iterator<Item = NvPairRef> + '_

Source

pub fn into_hashmap(self) -> HashMap<String, Value>

Source

pub fn is_empty(&self) -> bool

Source

pub fn exists<'a, N: IntoCStr<'a>>(&self, name: N) -> NvResult<bool>

Source

pub fn insert<'a, N: IntoCStr<'a>, T: NvTypeOp>( &mut self, name: N, value: T, ) -> NvResult<()>

Source

pub fn insert_boolean_value<'a, N: IntoCStr<'a>>( &mut self, name: N, value: bool, ) -> NvResult<()>

Add a bool to the list.

Source

pub fn insert_boolean<'a, N: IntoCStr<'a>>(&mut self, name: N) -> NvResult<()>

Add a bool to the list.

Source

pub fn get_boolean_value<'a, N: IntoCStr<'a>>(&self, name: N) -> NvResult<bool>

Get a bool from the list.

Source

pub fn get_boolean<'a, N: IntoCStr<'a>>(&self, name: N) -> NvResult<bool>

Get a bool from the list.

Source

pub fn insert_string<'a, 'b, N: IntoCStr<'a>, V: IntoCStr<'b>>( &mut self, name: N, value: V, ) -> NvResult<()>

Add a &str to the list.

Source

pub fn get_cstr<'a, N: IntoCStr<'a>>(&self, name: N) -> NvResult<&CStr>

Source

pub fn get_string<'a, N: IntoCStr<'a>>(&self, name: N) -> NvResult<String>

Get a String from the list.

Source

pub fn get_str<'a, N: IntoCStr<'a>>(&self, name: N) -> NvResult<&str>

Get a String from the list.

Source

pub fn save_as_json<F: AsRawFd>(&self, output: F) -> NvResult<()>

Turn NvPair into json representation. This method uses libnvpair to do so.

Trait Implementations§

Source§

impl Debug for NvList

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for NvList

Return new list with no flags.

Source§

fn default() -> NvList

Returns the “default value” for a type. Read more
Source§

impl Drop for NvList

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.