Struct relative_path::RelativePathBuf [] [src]

pub struct RelativePathBuf { /* fields omitted */ }

An owned, mutable relative path.

This type provides methods to manipulate relative path objects.

Methods

impl RelativePathBuf
[src]

[src]

Create a new relative path buffer.

[src]

Extends self with path.

If path is absolute, it replaces the current path.

Examples

use relative_path::{RelativePathBuf, RelativePath};

let mut path = RelativePathBuf::new();
path.push("foo");
path.push("bar");

assert_eq!("foo/bar", path);

[src]

Coerce to a RelativePath slice.

Methods from Deref<Target = RelativePath>

[src]

Creates an owned RelativePathBuf with path adjoined to self.

Examples

use relative_path::RelativePath;

let path = RelativePath::new("foo/bar");
assert_eq!("foo/bar/baz", path.join("baz"));

[src]

Iterate over all components in this relative path.

Examples

use relative_path::RelativePath;

let path = RelativePath::new("foo/bar/baz");
let mut it = path.components();

assert_eq!(Some("foo"), it.next());
assert_eq!(Some("bar"), it.next());
assert_eq!(Some("baz"), it.next());
assert_eq!(None, it.next());

[src]

Convert to an owned RelativePathBuf.

[src]

Build an owned PathBuf relative to path for the current relative path.

Examples

use relative_path::RelativePath;
use std::path::Path;

let path = RelativePath::new("foo/bar").to_path(Path::new("."));
assert_eq!(Path::new("./foo/bar"), path);

[src]

Check if path starts with a path separator.

[src]

Returns a relative path, without its final component if there is one.

Examples

use relative_path::RelativePath;

let path = RelativePath::new("foo/bar");
assert_eq!(Some(RelativePath::new("foo")), path.parent());

[src]

Return a relative path, resolved from the current path.

Examples

use relative_path::RelativePath;

assert_eq!(
    RelativePath::new("foo/baz.txt"),
    RelativePath::new("foo/bar").relativize_with("../baz.txt").as_relative_path()
);

[src]

Return a relative path, resolved from the current path by removing all relative components.

Examples

use relative_path::RelativePath;

assert_eq!(
    RelativePath::new("foo/baz.txt"),
    RelativePath::new("foo/./bar/../baz.txt").relativize().as_relative_path()
);

Trait Implementations

impl Clone for RelativePathBuf
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for RelativePathBuf
[src]

[src]

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

impl Debug for RelativePathBuf
[src]

[src]

Formats the value using the given formatter.

impl AsRef<RelativePath> for RelativePathBuf
[src]

[src]

Performs the conversion.

impl Borrow<RelativePath> for RelativePathBuf
[src]

[src]

Immutably borrows from an owned value. Read more

impl<'a, T: ?Sized + AsRef<str>> From<&'a T> for RelativePathBuf
[src]

[src]

Performs the conversion.

impl From<String> for RelativePathBuf
[src]

[src]

Performs the conversion.

impl Deref for RelativePathBuf
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

impl PartialEq for RelativePathBuf
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl Eq for RelativePathBuf
[src]

impl PartialOrd for RelativePathBuf
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for RelativePathBuf
[src]

[src]

This method returns an Ordering between self and other. Read more

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl Hash for RelativePathBuf
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl AsRef<str> for RelativePathBuf
[src]

[src]

Performs the conversion.

impl<'a, 'b> PartialEq<RelativePath> for RelativePathBuf
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl<'a, 'b> PartialOrd<RelativePath> for RelativePathBuf
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a, 'b> PartialEq<&'a RelativePath> for RelativePathBuf
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl<'a, 'b> PartialOrd<&'a RelativePath> for RelativePathBuf
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a, 'b> PartialEq<Cow<'a, RelativePath>> for RelativePathBuf
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl<'a, 'b> PartialOrd<Cow<'a, RelativePath>> for RelativePathBuf
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a, 'b> PartialEq<str> for RelativePathBuf
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl<'a, 'b> PartialOrd<str> for RelativePathBuf
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a, 'b> PartialEq<&'a str> for RelativePathBuf
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl<'a, 'b> PartialOrd<&'a str> for RelativePathBuf
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a, 'b> PartialEq<String> for RelativePathBuf
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl<'a, 'b> PartialOrd<String> for RelativePathBuf
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more