Trait openat::AsPath[][src]

pub trait AsPath {
    type Buffer: AsRef<CStr>;
    fn to_path(self) -> Option<Self::Buffer>;
}

The purpose of this is similar to AsRef<Path> but it’s optimized for things that can be directly used as CStr (which is type passed to the underlying system call).

This trait should be implemented for everything for which AsRef<Path> is implemented

Associated Types

type Buffer: AsRef<CStr>[src]

The return value of the to_path that holds data copied from the original path (if copy is needed, otherwise it’s just a reference)

Loading content...

Required methods

fn to_path(self) -> Option<Self::Buffer>[src]

Returns None when path contains a zero byte

Loading content...

Implementations on Foreign Types

impl<'a> AsPath for &'a Path[src]

impl<'a> AsPath for &'a PathBuf[src]

impl<'a> AsPath for &'a OsStr[src]

impl<'a> AsPath for &'a str[src]

impl<'a> AsPath for &'a String[src]

impl<'a> AsPath for String[src]

impl<'a> AsPath for &'a CStr[src]

type Buffer = &'a CStr

Loading content...

Implementors

impl<'a> AsPath for &'a Entry[src]

type Buffer = &'a CStr

Loading content...