Expand description
Path manipulation utilities
Windjammer’s path module provides a clean, ergonomic API for working with file system paths. It wraps Rust’s std::path but with simplified error handling.
Structs§
- Path
- Re-export std::path::Path for direct use
A slice of a path (akin to
str). - PathBuf
- Re-export std::path::PathBuf for direct use
An owned, mutable path (akin toString).
Functions§
- as_
os_ str - Get the path as an OsStr
- canonicalize
- Normalize a path (resolve . and ..)
- components
- Get components of the path as strings
- current_
dir - Get the current working directory
- exists
- Check if path exists
- extension
- Get the file extension (works with &str, &String, &Path, &PathBuf)
- file_
name - Get the file name from a path
- file_
stem - Get the file stem (name without extension)
- from_
str - Create a new PathBuf from a string
- has_
extension - Check if a path has a specific extension
- is_
absolute - Check if path is absolute
- is_dir
- Check if path is a directory
- is_file
- Check if path is a file
- is_
relative - Check if path is relative
- join
- Join path segments
- new
- Create a new Path from a string
- parent
- Get the parent directory
- strip_
prefix - Strip prefix from path
- to_
string - Convert path to string
- to_
string_ lossy - Convert path to string, lossy