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§
Macros§
Structs§
- Ancestors
- An iterator over
Pathand its ancestors. - Path
- A wrapper around
std::path::Pathwith extra invariants determined by itsForm. - PathBuf
- A wrapper around
std::path::PathBufwith extra invariants determined by itsForm. - TryAbsolute
Error - TryRelative
Error
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 whenpathcontains 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 trueif the path has a trailing slash, including if it’s the root directory.- home_
dir - is_
windows_ device_ path - 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
PWDenvironment variable.
Type Aliases§
- Absolute
Path - A path that is strictly absolute.
- Absolute
Path Buf - A path buf that is strictly absolute.
- Canonical
Path - An absolute, canonical path.
- Canonical
Path Buf - An absolute, canonical path buf.
- Relative
Path - A path that is strictly relative.
- Relative
Path Buf - A path buf that is strictly relative.