Portable, relative paths for Rust.
This library provides two structures:
These are analogous to the
PathBuf structures provided through standard rust.
Path provides an API that adapts to a given platform,
RelativePath is platform-neutral.
RelativePath only uses
/ as a separator. Anything else will be considered part of distinct
Only relative paths are permitted to be represented using this structure.
Path can only happen if it is provided which path it is relative to, through the
let relative_path = RelativePath::new("foo/bar"); let path = Path::new("C:\\"); let full_path = relative_path.to_path_buf(path);
RelativePath similarly to
Path makes no guarantees that the components represented in them
makes up a legal filesystem path.
NUL is not permitted on most unix platforms (this is a terminator in C-based filesystem
Windows also has a number of reserved characters.