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]
impl NormalizedPathpub fn new() -> Self[src]
pub fn new() -> SelfCreates a new, empty NormalizedPath.
pub fn new_normalized_logical(buf: PathBuf) -> Self[src]
pub fn new_normalized_logical(buf: PathBuf) -> SelfCreates 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.
pub fn new_normalized_physical(buf: PathBuf) -> Result<Self, NormalizationError>[src]
pub fn new_normalized_physical(buf: PathBuf) -> Result<Self, NormalizationError>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.
pub fn join_normalized_logial<P: AsRef<Path>>(&mut self, path: P)[src]
pub fn join_normalized_logial<P: AsRef<Path>>(&mut self, path: P)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).
pub fn join_normalized_physical<P: AsRef<Path>>(
&mut self,
path: P
) -> Result<(), NormalizationError>[src]
pub fn join_normalized_physical<P: AsRef<Path>>(
&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.
pub fn into_inner(self) -> PathBuf[src]
pub fn into_inner(self) -> PathBufUnwraps the inner PathBuf.
Methods from Deref<Target = PathBuf>
Trait Implementations
impl PartialEq for NormalizedPath[src]
impl PartialEq for NormalizedPathfn eq(&self, other: &NormalizedPath) -> bool[src]
fn eq(&self, other: &NormalizedPath) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &NormalizedPath) -> bool[src]
fn ne(&self, other: &NormalizedPath) -> boolThis method tests for !=.
impl Eq for NormalizedPath[src]
impl Eq for NormalizedPathimpl Clone for NormalizedPath[src]
impl Clone for NormalizedPathfn clone(&self) -> NormalizedPath[src]
fn clone(&self) -> NormalizedPathReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for NormalizedPath[src]
impl Debug for NormalizedPathfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Default for NormalizedPath[src]
impl Default for NormalizedPathfn default() -> NormalizedPath[src]
fn default() -> NormalizedPathReturns the "default value" for a type. Read more
impl Deref for NormalizedPath[src]
impl Deref for NormalizedPathAuto Trait Implementations
impl Send for NormalizedPath
impl Send for NormalizedPathimpl Sync for NormalizedPath
impl Sync for NormalizedPath