pub trait ToPlatform {
// Required methods
fn to_platform(&self) -> PathBuf;
fn to_platform_string(&self) -> String;
fn to_unix(&self) -> PathBuf;
}Expand description
Convert path separators to unix or to current platform. Detects platform natively or using NodeJS if operating under WASM32 environment. Since in WASM32 paths default to forward slashes, when running WASM32 in Windows paths needs to be converted back and forth for various path-related functions to work.
Required Methods§
Sourcefn to_platform(&self) -> PathBuf
fn to_platform(&self) -> PathBuf
Returns this path with separators converted to those of the current platform.
Sourcefn to_platform_string(&self) -> String
fn to_platform_string(&self) -> String
Returns this path as a string with current-platform separators.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".