Struct conch_runtime::path::NormalizedPath
[−]
[src]
pub struct NormalizedPath { /* fields omitted */ }A PathBuf wrapper which ensures paths do not have . or .. components.
Methods
impl NormalizedPath[src]
fn new() -> Self[src]
Creates a new, empty NormalizedPath.
fn new_normalized_logical(buf: PathBuf) -> Self[src]
Creates a new NormalizedPath instance with the provided buffer.
If buf is non-empty, it will be logically normalized as needed.
See the documentation for join_normalized_logial for more
information on how the normalization is performed.
fn new_normalized_physical(buf: PathBuf) -> Result<Self, NormalizationError>[src]
Creates a new NormalizedPath instance with the provided buffer.
If buf is non-empty, it will be physically normalized as needed.
See the documentation for join_normalized_physical for more
information on how the normalization is performed.
fn join_normalized_logial<P: AsRef<Path>>(&mut self, path: P)[src]
Joins a path to the buffer, normalizing away any . or .. components,
without following any symbolic links.
For example, joining ../some/path to /root/dir will yield
/root/some/path.
The normal behaviors of joining Paths will take effect (e.g. joining
with an absolute path will replace the previous contents).
fn join_normalized_physical<P: AsRef<Path>>(
&mut self,
path: P
) -> Result<(), NormalizationError>[src]
&mut self,
path: P
) -> Result<(), NormalizationError>
Joins a path to the buffer, normalizing away any . or .. components
after following any symbolic links.
For example, joining ../some/path to /root/dir (where /root/dir
is a symlink to /root/another/place) will yield /root/another/some/path.
The normal behaviors of joining Paths will take effect (e.g. joining
with an absolute path will replace the previous contents).
Errors
If an error occurs while resolving symlinks, the current path buffer will be reset to its previous state (as if the call never happened) before the error is propagated to the caller.
fn into_inner(self) -> PathBuf[src]
Unwraps the inner PathBuf.
Methods from Deref<Target = PathBuf>
fn as_path(&self) -> &Path1.0.0[src]
Coerces to a Path slice.
Examples
use std::path::{Path, PathBuf}; let p = PathBuf::from("/test"); assert_eq!(Path::new("/test"), p.as_path());
fn into_os_string(self) -> OsString1.0.0[src]
Consumes the PathBuf, yielding its internal OsString storage.
Examples
use std::path::PathBuf; let p = PathBuf::from("/the/head"); let os_str = p.into_os_string();
fn into_boxed_path(self) -> Box<Path>1.20.0[src]
Trait Implementations
impl PartialEq for NormalizedPath[src]
fn eq(&self, __arg_0: &NormalizedPath) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &NormalizedPath) -> bool[src]
This method tests for !=.
impl Eq for NormalizedPath[src]
impl Clone for NormalizedPath[src]
fn clone(&self) -> NormalizedPath[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Debug for NormalizedPath[src]
impl Default for NormalizedPath[src]
fn default() -> NormalizedPath[src]
Returns the "default value" for a type. Read more