Struct relative_path::RelativePath [] [src]

pub struct RelativePath { /* fields omitted */ }

A borrowed, immutable relative path.

Methods

impl RelativePath
[src]

[src]

Directly wraps a string slice as a RelativePath slice.

[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 ToOwned for RelativePath
[src]

[src]

Creates owned data from borrowed data, usually by cloning. Read more

[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl Debug for RelativePath
[src]

[src]

Formats the value using the given formatter.

impl AsRef<RelativePath> for RelativePath
[src]

[src]

Performs the conversion.

impl PartialEq for RelativePath
[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 RelativePath
[src]

impl PartialOrd for RelativePath
[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 RelativePath
[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 RelativePath
[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<'a, 'b> PartialEq<RelativePathBuf> for RelativePath
[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<RelativePathBuf> for RelativePath
[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<RelativePathBuf> for &'a RelativePath
[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<RelativePathBuf> for &'a RelativePath
[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 RelativePath
[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 RelativePath
[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 &'b RelativePath
[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 &'b RelativePath
[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 RelativePath
[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 RelativePath
[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 RelativePath
[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 RelativePath
[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 RelativePath
[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 RelativePath
[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 &'a RelativePath
[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 &'a RelativePath
[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 &'a RelativePath
[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 &'a RelativePath
[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