Crate libnv

source ·
Expand description

Rust bindings to Name/Value pairs libraries libnv and nvpair It kinda acts like Map<&str, T> for poor people. Library split into two modules: libnv and nvpairs. libnv is FreeBSD implementation that isn’t compatible with nvpairs that is Solaris implementation.

Modules

  • FreeBSD implementation of Name/value pairs library. All insert operation clone values using dup(2) system call. So you don’t have to worry about the lifetime of the value. Unless you leak NvList yourself using unsafe you don’t have to worry about anything. Once list goes out of scope it will call to C library to free all resources associated with it. nvlist_take_* and nvlist_move_* operations are not supported for this very reason.
  • Solaris implementation of Name/Value pairs library.

Enums

  • Error kinds for Name/Value library.

Traits

  • Trait to keep public interface friendly (i.e. support rust types like &str) and at the same time allow using lower level types like CString & CStr.

Type Definitions

  • Short-cut to Result<T, NvError>.