Trait nix::NixPath

pub trait NixPath {    
    fn is_empty(&Self) -> bool;
    
    fn len(&Self) -> usize;
    
    fn with_nix_path<T, F>(&Self, f: F) -> Result<T>
    where
        F: FnOnce(&CStr) -> T
;
}
Documentation

Common trait used to represent file system paths by many Nix functions.

Required Methods

fn is_empty(&Self) -> bool

Is the path empty?

fn len(&Self) -> usize

Length of the path in bytes

fn with_nix_path<T, F>(&Self, f: F) -> Result<T>
where
    F: FnOnce(&CStr) -> T

Execute a function with this path as a CStr.

Mostly used internally by Nix.

Implementations on Foreign Types

impl NixPath for CStr
fn is_empty(&Self) -> bool
fn len(&Self) -> usize
fn with_nix_path<T, F>(&Self, f: F) -> Result<T>
where
    F: FnOnce(&CStr) -> T
impl NixPath for OsStr
fn is_empty(&Self) -> bool
fn len(&Self) -> usize
fn with_nix_path<T, F>(&Self, f: F) -> Result<T>
where
    F: FnOnce(&CStr) -> T
impl NixPath for Path
fn is_empty(&Self) -> bool
fn len(&Self) -> usize
fn with_nix_path<T, F>(&Self, f: F) -> Result<T>
where
    F: FnOnce(&CStr) -> T
impl NixPath for PathBuf
fn is_empty(&Self) -> bool
fn len(&Self) -> usize
fn with_nix_path<T, F>(&Self, f: F) -> Result<T>
where
    F: FnOnce(&CStr) -> T
impl NixPath for [u8]
fn is_empty(&Self) -> bool
fn len(&Self) -> usize
fn with_nix_path<T, F>(&Self, f: F) -> Result<T>
where
    F: FnOnce(&CStr) -> T
impl NixPath for str
fn is_empty(&Self) -> bool
fn len(&Self) -> usize
fn with_nix_path<T, F>(&Self, f: F) -> Result<T>
where
    F: FnOnce(&CStr) -> T