pub trait PathUtil {
// Required methods
fn normalize(&self) -> PathBuf;
fn normalize_relative(&self) -> PathBuf;
fn normalize_with<P: AsRef<Path>>(&self, subpath: P) -> PathBuf;
fn is_invalid_exports_target(&self) -> bool;
}Expand description
Extension trait to add path normalization to std’s Path.
Required Methods§
Sourcefn normalize(&self) -> PathBuf
fn normalize(&self) -> PathBuf
Normalize this path without performing I/O.
All redundant separator and up-level references are collapsed.
However, this does not resolve links.
Sourcefn normalize_relative(&self) -> PathBuf
fn normalize_relative(&self) -> PathBuf
Like normalize, but don’t require the path to be absolute.
Sourcefn normalize_with<P: AsRef<Path>>(&self, subpath: P) -> PathBuf
fn normalize_with<P: AsRef<Path>>(&self, subpath: P) -> PathBuf
Normalize with subpath assuming this path is normalized without performing I/O.
All redundant separator and up-level references are collapsed.
However, this does not resolve links.
Sourcefn is_invalid_exports_target(&self) -> bool
fn is_invalid_exports_target(&self) -> bool
Defined in ESM PACKAGE_TARGET_RESOLVE If target split on “/” or “" contains any “”, “.”, “..”, or “node_modules” segments after the first “.” segment, case insensitive and including percent encoded variants
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.