pub trait PathExt {
// Required methods
fn slash_str(&self) -> String;
fn full_str(&self) -> &str;
fn ext_str(&self) -> &str;
fn stem_str(&self) -> &str;
fn name_str(&self) -> &str;
fn create_parent_dir_all(&self) -> Result<()>;
fn merge<P: AsRef<Path>>(&self, append: P) -> PathBuf;
fn is_file(&self) -> bool;
fn is_dir(&self) -> bool;
fn walk_dir<F: Fn(&Path) -> bool>(&self, filter: F) -> Vec<PathBuf>;
fn walk_iter<F: Fn(&Path) -> bool>(
&self,
filter: F,
) -> impl Iterator<Item = PathBuf>;
fn mkdir_after_remove(&self) -> Result<PathBuf>;
}
Required Methods§
Sourcefn slash_str(&self) -> String
fn slash_str(&self) -> String
output full path with slash
e.g. “test\test.txt” -> “test/test.txt”
Sourcefn full_str(&self) -> &str
fn full_str(&self) -> &str
output full path with backslash
e.g. “test/test.txt” -> “test\test.txt”
fn ext_str(&self) -> &str
fn stem_str(&self) -> &str
fn name_str(&self) -> &str
fn create_parent_dir_all(&self) -> Result<()>
fn merge<P: AsRef<Path>>(&self, append: P) -> PathBuf
fn is_file(&self) -> bool
fn is_dir(&self) -> bool
fn walk_dir<F: Fn(&Path) -> bool>(&self, filter: F) -> Vec<PathBuf>
fn walk_iter<F: Fn(&Path) -> bool>( &self, filter: F, ) -> impl Iterator<Item = PathBuf>
fn mkdir_after_remove(&self) -> Result<PathBuf>
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.