pub fn subvolume_info<P: AsRef<Path>>(
    path: P,
    id: Option<NonZeroU64>,
) -> Result<SubvolumeInfo, Error> {
    let cpath = CString::new(path.as_ref().as_os_str().as_bytes()).unwrap();
    let cid = id.map_or(0, |i| i.get());
    let mut out = SubvolumeInfo::new();
    unsafe {
        let errcode = ffi::btrfs_util_subvolume_info(cpath.as_ptr(), cid, out.as_ptr());
        if errcode != ffi::btrfs_util_error_BTRFS_UTIL_OK {
            return Err(errcode.into());
        }
    }
    Ok(out)
}
/// Gets information about a subvolume.
Gets information about a subvolume.
Gets information about a subvolume .
pub fn subvolume_info<P: AsRef<Path>>(
    path: P,
    id: Option<NonZeroU64>,
) -> Result<SubvolumeInfo, Error> {
    let cpath = CString::new(path.as_ref().as_os_str().as_bytes()).unwrap();
    let cid = id.map_or(0, |i| i.get());
    let mut out = SubvolumeInfo::new();
    unsafe {
        let errcode = ffi::btrfs_util_subvolume_info(cpath.as_ptr(), cid, out.as_ptr());
        if errcode != ffi::btrfs_util_error_BTRFS_UTIL_OK {
            return Err(errcode.into());
        }
    }
    Ok(out)
}
pub fn subvolume_info < P : AsRef < Path > > ( path : P , id : Option < NonZeroU64 > , ) -> Result < SubvolumeInfo , Error > { let cpath = CString :: new ( path . as_ref ( ) . as_os_str ( ) . as_bytes ( ) ) . unwrap ( ) ; let cid = id . map_or ( 0 , | i | i . get ( ) ) ; let mut out = SubvolumeInfo :: new ( ) ; unsafe { let errcode = ffi :: btrfs_util_subvolume_info ( cpath . as_ptr ( ) , cid , out . as_ptr ( ) ) ; if errcode != ffi :: btrfs_util_error_BTRFS_UTIL_OK { return Err ( errcode . into ( ) ) ; } } Ok ( out ) }
Gets information about a subvolume.
Gets information about a subvolume .
path
P
id
Option<NonZeroU64>
path
P
id
Option<NonZeroU64>