Struct bitflags::__core::path::Path
[−]
[src]
pub struct Path { // some fields omitted }1.0.0
A slice of a path (akin to str
).
This type supports a number of operations for inspecting a path, including
breaking the path into its components (separated by /
or \
, depending on
the platform), extracting the file name, determining whether the path is
absolute, and so on. More details about the overall approach can be found in
the module documentation.
This is an unsized type, meaning that it must always be used behind a
pointer like &
or Box
.
Examples
use std::path::Path; let path = Path::new("/tmp/foo/bar.txt"); let file = path.file_name(); let extension = path.extension(); let parent_dir = path.parent();