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]
fn new() -> RelativePathBuf
[src]
Create a new relative path buffer, guaranteeing that it is relative.
A relative path is one that does not start with a path separator (/
).
fn join<P: AsRef<RelativePath>>(&self, path: P) -> RelativePathBuf
[src]
Join this relative path with another relative path.
fn push<P: AsRef<RelativePath>>(&mut self, path: P)
[src]
Push another relative path to this path.
- Ignore sequences of separators (
/
).
fn to_relative_path_buf(&self) -> RelativePathBuf
[src]
Convert to an owned RelativePathBuf
.
fn components(&self) -> Components
[src]
Iterate over all components in this relative path.
Skips over the separator.
fn to_relative_of<P: AsRef<Path>>(&self, relative_to: P) -> PathBuf
[src]
Create a new path buffer relative to the given path.
The created path will be relative to the provided relative_to
argument.
Examples
use relative_path::RelativePath; use std::path::Path; let path_buf = RelativePath::new("foo/bar").to_relative_of(Path::new("."));
fn is_absolute(&self) -> bool
[src]
Check if path starts with a path separator.
Methods from Deref<Target = RelativePath>
fn join<P: AsRef<RelativePath>>(&self, path: P) -> RelativePathBuf
[src]
Join this relative path with another relative path.
fn components(&self) -> Components
[src]
Iterate over all components in this relative path.
fn to_relative_path_buf(&self) -> RelativePathBuf
[src]
Convert to an owned RelativePathBuf
.
fn to_relative_of<P: AsRef<Path>>(&self, relative_to: P) -> PathBuf
[src]
Create a new path buffer relative to the given path.
fn is_absolute(&self) -> bool
[src]
Check if path starts with a path separator.
Trait Implementations
impl Clone for RelativePathBuf
[src]
fn clone(&self) -> RelativePathBuf
[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 RelativePathBuf
[src]
impl AsRef<RelativePath> for RelativePathBuf
[src]
fn as_ref(&self) -> &RelativePath
[src]
Performs the conversion.
impl Borrow<RelativePath> for RelativePathBuf
[src]
fn borrow(&self) -> &RelativePath
[src]
Immutably borrows from an owned value. Read more
impl From<String> for RelativePathBuf
[src]
fn from(value: String) -> RelativePathBuf
[src]
Performs the conversion.
impl Deref for RelativePathBuf
[src]
type Target = RelativePath
The resulting type after dereferencing.
fn deref(&self) -> &RelativePath
[src]
Dereferences the value.
impl PartialEq for RelativePathBuf
[src]
fn eq(&self, other: &RelativePathBuf) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Eq for RelativePathBuf
[src]
impl PartialOrd for RelativePathBuf
[src]
fn partial_cmp(&self, other: &RelativePathBuf) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
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]
fn cmp(&self, other: &RelativePathBuf) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl<'a, 'b> PartialEq<RelativePath> for RelativePathBuf
[src]
fn eq(&self, other: &RelativePath) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialOrd<RelativePath> for RelativePathBuf
[src]
fn partial_cmp(&self, other: &RelativePath) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
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]
fn eq(&self, other: &&'a RelativePath) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialOrd<&'a RelativePath> for RelativePathBuf
[src]
fn partial_cmp(&self, other: &&'a RelativePath) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
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]
fn eq(&self, other: &Cow<'a, RelativePath>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialOrd<Cow<'a, RelativePath>> for RelativePathBuf
[src]
fn partial_cmp(&self, other: &Cow<'a, RelativePath>) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
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]
fn eq(&self, other: &str) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialOrd<str> for RelativePathBuf
[src]
fn partial_cmp(&self, other: &str) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
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]
fn eq(&self, other: &&'a str) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialOrd<&'a str> for RelativePathBuf
[src]
fn partial_cmp(&self, other: &&'a str) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
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]
fn eq(&self, other: &String) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialOrd<String> for RelativePathBuf
[src]
fn partial_cmp(&self, other: &String) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more