pub async fn usage<T: AsRef<Path>>(path: T) -> Result<Usage> {
    let path = path
        .as_ref()
        .to_str()
        .ok_or_else(|| io::Error::from(io::ErrorKind::InvalidInput))
        .and_then(|string| {
            CString::new(string).map_err(|_| io::Error::from(io::ErrorKind::InvalidInput))
        })
        .map_err(|e| Error::from(e).with_message("Invalid path"))?;

    let mut vfs = mem::MaybeUninit::<libc::statvfs>::uninit();
    let result = unsafe { libc::statvfs(path.as_ptr(), vfs.as_mut_ptr()) };

    if result == 0 {
        let vfs = unsafe { vfs.assume_init() };
        Ok(Usage(vfs))
    } else {
        Err(Error::last_os_error().with_ffi("statvfs"))
    }
}
// TODO: It is an internal function, we could monomorphize it and accept `path: &Path`
It is an internal function, we could monomorphize it and accept `path: &Path`
It is an internal function we could monomorphize it and accept ` path : &Path `
pub async fn usage<T: AsRef<Path>>(path: T) -> Result<Usage> {
    let path = path
        .as_ref()
        .to_str()
        .ok_or_else(|| io::Error::from(io::ErrorKind::InvalidInput))
        .and_then(|string| {
            CString::new(string).map_err(|_| io::Error::from(io::ErrorKind::InvalidInput))
        })
        .map_err(|e| Error::from(e).with_message("Invalid path"))?;
    let mut vfs = mem::MaybeUninit::<libc::statvfs>::uninit();
    let result = unsafe { libc::statvfs(path.as_ptr(), vfs.as_mut_ptr()) };
    if result == 0 {
        let vfs = unsafe { vfs.assume_init() };
        Ok(Usage(vfs))
    } else {
        Err(Error::last_os_error().with_ffi("statvfs"))
    }
}
pub async fn usage < T : AsRef < Path > > ( path : T ) -> Result < Usage > { let path = path . as_ref ( ) . to_str ( ) . ok_or_else ( | | io :: Error :: from ( io :: ErrorKind :: InvalidInput ) ) . and_then ( | string | { CString :: new ( string ) . map_err ( | _ | io :: Error :: from ( io :: ErrorKind :: InvalidInput ) ) } ) . map_err ( | e | Error :: from ( e ) . with_message ( " " ) ) ? ; let mut vfs = mem :: MaybeUninit :: < libc :: statvfs > :: uninit ( ) ; let result = unsafe { libc :: statvfs ( path . as_ptr ( ) , vfs . as_mut_ptr ( ) ) } ; if result == 0 { let vfs = unsafe { vfs . assume_init ( ) } ; Ok ( Usage ( vfs ) ) } else { Err ( Error :: last_os_error ( ) . with_ffi ( " " ) ) } }
TODO: It is an internal function, we could monomorphize it and accept `path: &Path`
TODO : It is an internal function we could monomorphize it and accept ` path : &Path `
path
T
path
T