razor_libnvpair_sys/
lib.rs

1#![allow(non_camel_case_types)]
2#![allow(non_snake_case)]
3#![allow(deref_nullptr)]
4
5//!
6//! This module provides immediate bindings to libnvpair library.
7//! It is not intended for direct use, but rather serves as an FFI layer.
8//!
9include!(concat!(env!("OUT_DIR"), "/nvpair.rs"));
10
11impl From<boolean_t> for bool {
12    fn from(value: boolean_t) -> Self {
13        match value {
14            boolean_t::B_FALSE => false,
15            boolean_t::B_TRUE => true,
16        }
17    }
18}
19
20impl From<&boolean_t> for bool {
21    fn from(value: &boolean_t) -> Self {
22        match value {
23            boolean_t::B_FALSE => false,
24            boolean_t::B_TRUE => true,
25        }
26    }
27}
28
29impl From<bool> for boolean_t {
30    fn from(value: bool) -> Self {
31        match value {
32            false => boolean_t::B_FALSE,
33            true => boolean_t::B_TRUE,
34        }
35    }
36}
37
38impl From<&bool> for boolean_t {
39    fn from(value: &bool) -> Self {
40        match value {
41            false => boolean_t::B_FALSE,
42            true => boolean_t::B_TRUE,
43        }
44    }
45}