Crate nu_path

Crate nu_path 

Source
Expand description

§nu-path

This crate takes care of path handling in Nushell, such as canonicalization and component expansion, as well as other path-related utilities.

Re-exports§

pub use expansions::canonicalize_with;
pub use expansions::expand_path;
pub use expansions::expand_path_with;
pub use expansions::expand_to_real_path;
pub use expansions::locate_in_dirs;

Modules§

dots
expansions
form

Macros§

assert_path_eq
assert_path_ne

Structs§

Ancestors
An iterator over Path and its ancestors.
Path
A wrapper around std::path::Path with extra invariants determined by its Form.
PathBuf
A wrapper around std::path::PathBuf with extra invariants determined by its Form.
TryAbsoluteError
TryRelativeError

Functions§

cache_dir
Return the cache directory for the current platform or XDG_CACHE_HOME if specified.
components
Like Path::components(), but produces an extra empty component at the end when path contains a trailing slash.
data_dir
Return the data directory for the current platform or XDG_DATA_HOME if specified.
expand_tilde
Expand tilde (“~”) into a home directory if it is the first path component
has_trailing_slash
true if the path has a trailing slash, including if it’s the root directory.
home_dir
nu_config_dir
Return the nushell config directory.
strip_trailing_slash
Strip any trailing slashes from a non-root path. This is required in some contexts, for example for the PWD environment variable.

Type Aliases§

AbsolutePath
A path that is strictly absolute.
AbsolutePathBuf
A path buf that is strictly absolute.
CanonicalPath
An absolute, canonical path.
CanonicalPathBuf
An absolute, canonical path buf.
RelativePath
A path that is strictly relative.
RelativePathBuf
A path buf that is strictly relative.