razor-libzfscore 0.13.1

Low-level libzfs_core interface
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::*;

pub(crate) static LIBZFS_CORE: Lazy<Lzc> = Lazy::new(Lzc::init);

pub(crate) struct Lzc;

impl Lzc {
    fn init() -> Self {
        let _rc = unsafe { sys::libzfs_core_init() };
        Self
    }
}

impl Drop for Lzc {
    fn drop(&mut self) {
        unsafe { sys::libzfs_core_fini() }
    }
}