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]

[src]

Creates a new, empty NormalizedPath.

[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.

[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.

[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).

[src]

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.

[src]

Unwraps the inner PathBuf.

Methods from Deref<Target = PathBuf>

1.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());

1.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();

1.20.0
[src]

Converts this PathBuf into a boxed Path.

Trait Implementations

impl PartialEq for NormalizedPath
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for NormalizedPath
[src]

impl Clone for NormalizedPath
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for NormalizedPath
[src]

[src]

Formats the value using the given formatter.

impl Default for NormalizedPath
[src]

[src]

Returns the "default value" for a type. Read more

impl Deref for NormalizedPath
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.