Skip to main content

Crate illumos_nvpair

Crate illumos_nvpair 

Source
Expand description

Idiomatic Rust representation of illumos nvlists.

This crate converts raw nvlist_t pointers (from libnvpair) into pure Rust types with no raw pointers or FFI in the public API.

§Example

use illumos_nvpair::{NvList, NvValue};

// Given a raw nvlist pointer from some illumos API:
let nvl = unsafe { NvList::from_raw(raw_ptr) }?;

if let Some(NvValue::String(s)) = nvl.lookup("name") {
    println!("name = {s}");
}

Structs§

NvList
An ordered list of name-value pairs, converted from an illumos nvlist.
OwnedNvList
Owning RAII handle to a live nvlist_t allocated by libnvpair (or by any illumos API that returns an nvlist_t * with caller-frees-it semantics).

Enums§

NvError
Error returned when reading an nvpair value fails.
NvValue
A value from an nvlist pair.