pub trait BytePath<T>{
Show 24 methods
// Required methods
fn as_cstr_ptr<F, R, VT>(&self, f: F) -> R
where F: FnOnce(*const VT) -> R,
VT: ValueType;
fn extension(&self) -> Option<&[u8]>;
fn matches_extension(&self, ext: &[u8]) -> bool;
fn size(&self) -> Result<u64>;
fn get_stat(&self) -> Result<stat>;
fn modified_time(&self) -> Result<SystemTime>;
fn as_path(&self) -> &Path;
unsafe fn open_fd(&self) -> Result<i32>;
fn file_name_index(&self) -> u16;
fn as_os_str(&self) -> &OsStr;
fn exists(&self) -> bool;
fn to_direntry<S>(&self) -> Result<DirEntry<S>>
where S: BytesStorage;
fn is_readable(&self) -> bool;
fn is_writable(&self) -> bool;
fn metadata(&self) -> Result<Metadata>;
fn components(&self) -> impl Iterator<Item = &[u8]>;
fn to_std_file_type(&self) -> Result<FileType>;
fn as_str(&self) -> Result<&str>;
unsafe fn as_str_unchecked(&self) -> &str;
fn to_string_lossy(&self) -> Cow<'_, str>;
fn is_absolute(&self) -> bool;
fn is_relative(&self) -> bool;
fn to_path(&self) -> PathBuf;
fn realpath(&self) -> Result<&[u8]>;
}Expand description
a trait over anything which derefs to &[u8] then convert to *const i8 or *const u8 (inferred ), useful for FFI.
Required Methods§
fn as_cstr_ptr<F, R, VT>(&self, f: F) -> R
fn extension(&self) -> Option<&[u8]>
fn matches_extension(&self, ext: &[u8]) -> bool
fn size(&self) -> Result<u64>
fn get_stat(&self) -> Result<stat>
fn modified_time(&self) -> Result<SystemTime>
fn as_path(&self) -> &Path
unsafe fn open_fd(&self) -> Result<i32>
fn file_name_index(&self) -> u16
fn as_os_str(&self) -> &OsStr
fn exists(&self) -> bool
fn to_direntry<S>(&self) -> Result<DirEntry<S>>where
S: BytesStorage,
fn is_readable(&self) -> bool
fn is_writable(&self) -> bool
fn metadata(&self) -> Result<Metadata>
fn components(&self) -> impl Iterator<Item = &[u8]>
fn to_std_file_type(&self) -> Result<FileType>
fn as_str(&self) -> Result<&str>
unsafe fn as_str_unchecked(&self) -> &str
fn to_string_lossy(&self) -> Cow<'_, str>
fn is_absolute(&self) -> bool
fn is_relative(&self) -> bool
fn to_path(&self) -> PathBuf
fn realpath(&self) -> Result<&[u8]>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.