Struct reproto_core::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]
pub fn new() -> RelativePathBuf
[src]
Create a new relative path buffer.
pub fn from_path<P>(path: P) -> Result<RelativePathBuf, FromPathError> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
Convert a Path
to a RelativePathBuf
.
Examples
use relative_path::{RelativePath, RelativePathBuf, FromPathErrorKind}; use std::path::Path; use std::ffi::OsStr; assert_eq!( Ok(RelativePath::new("foo/bar").to_owned()), RelativePathBuf::from_path(Path::new("foo/bar")) ); if cfg!(unix) { assert_eq!( Err(FromPathErrorKind::NonRelative.into()), RelativePathBuf::from_path(Path::new("/foo/bar")) ); use std::os::unix::ffi::OsStrExt; // Continuation byte without continuation. let non_utf8 = OsStr::from_bytes(&[0x80u8]); assert_eq!( Err(FromPathErrorKind::NonUtf8.into()), RelativePathBuf::from_path(Path::new(non_utf8)) ); } if cfg!(windows) { assert_eq!( Err(FromPathErrorKind::NonRelative.into()), RelativePathBuf::from_path(Path::new("c:\\foo\\bar")) ); }
pub fn push<P>(&mut self, path: P) where
P: AsRef<RelativePath>,
[src]
P: AsRef<RelativePath>,
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);
pub fn set_file_name<S>(&mut self, file_name: S) where
S: AsRef<str>,
[src]
S: AsRef<str>,
Updates self.file_name
to file_name
.
If self.file_name
was None
, this is equivalent to pushing
file_name
.
Otherwise it is equivalent to calling pop
and then pushing
file_name
. The new path will be a sibling of the original path.
(That is, it will have the same parent.)
Examples
use relative_path::RelativePathBuf; let mut buf = RelativePathBuf::from(""); assert!(buf.file_name() == None); buf.set_file_name("bar"); assert_eq!(RelativePathBuf::from("bar"), buf); assert!(buf.file_name().is_some()); buf.set_file_name("baz.txt"); assert_eq!(RelativePathBuf::from("baz.txt"), buf); buf.push("bar"); assert!(buf.file_name().is_some()); buf.set_file_name("bar.txt"); assert_eq!(RelativePathBuf::from("baz.txt/bar.txt"), buf);
pub fn set_extension<S>(&mut self, extension: S) -> bool where
S: AsRef<str>,
[src]
S: AsRef<str>,
Updates self.extension
to extension
.
Returns false
and does nothing if self.file_name
is None
,
returns true
and updates the extension otherwise.
If self.extension
is None
, the extension is added; otherwise
it is replaced.
Examples
use relative_path::{RelativePath, RelativePathBuf}; let mut p = RelativePathBuf::from("feel/the"); p.set_extension("force"); assert_eq!(RelativePath::new("feel/the.force"), p); p.set_extension("dark_side"); assert_eq!(RelativePath::new("feel/the.dark_side"), p); assert!(p.pop()); p.set_extension("nothing"); assert_eq!(RelativePath::new("feel.nothing"), p);
pub fn pop(&mut self) -> bool
[src]
Truncates self
to self.parent
.
Returns false
and does nothing if self.file_name
is None
.
Otherwise, returns true
.
Examples
use relative_path::{RelativePath, RelativePathBuf}; let mut p = RelativePathBuf::from("test/test.rs"); assert_eq!(true, p.pop()); assert_eq!(RelativePath::new("test"), p); assert_eq!(false, p.pop()); assert_eq!(RelativePath::new("test"), p);
pub fn as_relative_path(&self) -> &RelativePath
[src]
Coerce to a RelativePath
slice.
Methods from Deref<Target = RelativePath>
pub fn as_str(&self) -> &str
[src]
Yields the underlying str
slice.
Examples
use relative_path::RelativePath; assert_eq!(RelativePath::new("foo.txt").as_str(), "foo.txt");
pub fn display(&self) -> Display
[src]
Returns an object that implements [Display
].
Examples
use relative_path::RelativePath; let path = RelativePath::new("tmp/foo.rs"); println!("{}", path.display());
pub fn join<P>(&self, path: P) -> RelativePathBuf where
P: AsRef<RelativePath>,
[src]
P: AsRef<RelativePath>,
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"));
ⓘImportant traits for Components<'a>pub fn components(&self) -> Components
[src]
Iterate over all components in this relative path.
Examples
use relative_path::{Component, RelativePath}; let path = RelativePath::new("foo/bar/baz"); let mut it = path.components(); assert_eq!(Some(Component::Normal("foo")), it.next()); assert_eq!(Some(Component::Normal("bar")), it.next()); assert_eq!(Some(Component::Normal("baz")), it.next()); assert_eq!(None, it.next());
ⓘImportant traits for Iter<'a>pub fn iter(&self) -> Iter
[src]
Produces an iterator over the path's components viewed as str
slices.
For more information about the particulars of how the path is separated
into components, see components
.
Examples
use relative_path::RelativePath; let mut it = RelativePath::new("/tmp/foo.txt").iter(); assert_eq!(it.next(), Some("tmp")); assert_eq!(it.next(), Some("foo.txt")); assert_eq!(it.next(), None)
pub fn to_relative_path_buf(&self) -> RelativePathBuf
[src]
Convert to an owned RelativePathBuf
.
pub fn to_path<P>(&self, relative_to: P) -> PathBuf where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
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);
pub fn parent(&self) -> Option<&RelativePath>
[src]
Returns a relative path, without its final component if there is one.
Examples
use relative_path::RelativePath; assert_eq!(Some(RelativePath::new("foo")), RelativePath::new("foo/bar").parent()); assert_eq!(None, RelativePath::new("foo").parent()); assert_eq!(None, RelativePath::new("").parent());
pub fn file_name(&self) -> Option<&str>
[src]
Returns the final component of the RelativePath
, if there is one.
If the path is a normal file, this is the file name. If it's the path of a directory, this is the directory name.
Returns None
If the path terminates in ..
.
Examples
use relative_path::RelativePath; assert_eq!(Some("bin"), RelativePath::new("usr/bin/").file_name()); assert_eq!(Some("foo.txt"), RelativePath::new("tmp/foo.txt").file_name()); assert_eq!(Some("foo.txt"), RelativePath::new("tmp/foo.txt/").file_name()); assert_eq!(Some("foo.txt"), RelativePath::new("foo.txt/.").file_name()); assert_eq!(Some("foo.txt"), RelativePath::new("foo.txt/.//").file_name()); assert_eq!(None, RelativePath::new("foo.txt/..").file_name()); assert_eq!(None, RelativePath::new("/").file_name());
pub fn strip_prefix<P>(
&'a self,
base: &'a P
) -> Result<&'a RelativePath, StripPrefixError> where
P: AsRef<RelativePath> + ?Sized,
[src]
&'a self,
base: &'a P
) -> Result<&'a RelativePath, StripPrefixError> where
P: AsRef<RelativePath> + ?Sized,
Returns a relative path that, when joined onto base
, yields self
.
Errors
If base
is not a prefix of self
(i.e. starts_with
returns false
), returns Err
.
Examples
use relative_path::RelativePath; let path = RelativePath::new("test/haha/foo.txt"); assert_eq!(path.strip_prefix("test"), Ok(RelativePath::new("haha/foo.txt"))); assert_eq!(path.strip_prefix("test").is_ok(), true); assert_eq!(path.strip_prefix("haha").is_ok(), false);
pub fn starts_with<P>(&self, base: P) -> bool where
P: AsRef<RelativePath>,
[src]
P: AsRef<RelativePath>,
Determines whether base
is a prefix of self
.
Only considers whole path components to match.
Examples
use relative_path::RelativePath; let path = RelativePath::new("etc/passwd"); assert!(path.starts_with("etc")); assert!(!path.starts_with("e"));
pub fn ends_with<P>(&self, child: P) -> bool where
P: AsRef<RelativePath>,
[src]
P: AsRef<RelativePath>,
Determines whether child
is a suffix of self
.
Only considers whole path components to match.
Examples
use relative_path::RelativePath; let path = RelativePath::new("etc/passwd"); assert!(path.ends_with("passwd"));
pub fn with_file_name<S>(&self, file_name: S) -> RelativePathBuf where
S: AsRef<str>,
[src]
S: AsRef<str>,
Creates an owned RelativePathBuf
like self
but with the given file name.
See RelativePathBuf::set_file_name
for more details.
Examples
use relative_path::{RelativePath, RelativePathBuf}; let path = RelativePath::new("tmp/foo.txt"); assert_eq!(path.with_file_name("bar.txt"), RelativePathBuf::from("tmp/bar.txt")); let path = RelativePath::new("tmp"); assert_eq!(path.with_file_name("var"), RelativePathBuf::from("var"));
pub fn file_stem(&self) -> Option<&str>
[src]
Extracts the stem (non-extension) portion of self.file_name
.
The stem is:
None
, if there is no file name;- The entire file name if there is no embedded
.
; - The entire file name if the file name begins with
.
and has no other.
s within; - Otherwise, the portion of the file name before the final
.
Examples
use relative_path::RelativePath; let path = RelativePath::new("foo.rs"); assert_eq!("foo", path.file_stem().unwrap());
pub fn extension(&self) -> Option<&str>
[src]
Extracts the extension of self.file_name
, if possible.
The extension is:
None
, if there is no file name;None
, if there is no embedded.
;None
, if the file name begins with.
and has no other.
s within;- Otherwise, the portion of the file name after the final
.
Examples
use relative_path::RelativePath; assert_eq!(Some("rs"), RelativePath::new("foo.rs").extension()); assert_eq!(None, RelativePath::new(".rs").extension()); assert_eq!(Some("rs"), RelativePath::new("foo.rs/.").extension());
pub fn with_extension<S>(&self, extension: S) -> RelativePathBuf where
S: AsRef<str>,
[src]
S: AsRef<str>,
Creates an owned RelativePathBuf
like self
but with the given extension.
See RelativePathBuf::set_extension
for more details.
Examples
use relative_path::{RelativePath, RelativePathBuf}; let path = RelativePath::new("foo.rs"); assert_eq!(path.with_extension("txt"), RelativePathBuf::from("foo.txt"));
pub fn join_normalized<P>(&self, path: P) -> RelativePathBuf where
P: AsRef<RelativePath>,
[src]
P: AsRef<RelativePath>,
Build an owned RelativePathBuf
, joined with the given path and normalized.
Examples
use relative_path::RelativePath; assert_eq!( RelativePath::new("foo/baz.txt"), RelativePath::new("foo/bar").join_normalized("../baz.txt").as_relative_path() ); assert_eq!( RelativePath::new("../foo/baz.txt"), RelativePath::new("../foo/bar").join_normalized("../baz.txt").as_relative_path() );
pub fn normalize(&self) -> RelativePathBuf
[src]
Return an owned RelativePathBuf
, with all non-normal components moved to the beginning of
the path.
This permits for a normalized representation of different relative components.
Normalization is a destructive operation if the path references an actual filesystem
path.
An example of this is symlinks under unix, a path like foo/../bar
might reference a
different location other than ./bar
.
Normalization is a logical operation that is only valid if the relative path is part of some context which doesn't have semantics that causes it to break, like symbolic links.
Examples
use relative_path::RelativePath; assert_eq!( RelativePath::new("../foo/baz.txt"), RelativePath::new("../foo/./bar/../baz.txt").normalize().as_relative_path() );
Trait Implementations
impl Default for RelativePathBuf
[src]
fn default() -> RelativePathBuf
[src]
Returns the "default value" for a type. Read more
impl<'a, T> From<&'a T> for RelativePathBuf where
T: AsRef<str> + ?Sized,
[src]
T: AsRef<str> + ?Sized,
fn from(path: &'a T) -> RelativePathBuf
[src]
Performs the conversion.
impl From<String> for RelativePathBuf
[src]
fn from(path: String) -> RelativePathBuf
[src]
Performs the conversion.
impl<'a> From<RelativePathBuf> for Cow<'a, RelativePath>
[src]
fn from(s: RelativePathBuf) -> Cow<'a, RelativePath>
[src]
Performs the conversion.
impl Serialize for RelativePathBuf
[src]
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
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<'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> 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> PartialOrd<RelativePathBuf> for Cow<'a, RelativePath>
[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<'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> PartialOrd<RelativePathBuf> for &'a RelativePath
[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 PartialOrd<RelativePathBuf> 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<'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
impl<'a, 'b> PartialOrd<RelativePathBuf> for String
[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<'a, 'b> PartialOrd<RelativePathBuf> for str
[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<'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> PartialOrd<RelativePathBuf> for &'a str
[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<'a, 'b> PartialOrd<RelativePathBuf> for RelativePath
[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<'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 AsRef<RelativePath> for RelativePathBuf
[src]
fn as_ref(&self) -> &RelativePath
[src]
Performs the conversion.
impl AsRef<str> for RelativePathBuf
[src]
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.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Hash for RelativePathBuf
[src]
fn hash<H>(&self, h: &mut H) where
H: Hasher,
[src]
H: Hasher,
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Borrow<RelativePath> for RelativePathBuf
[src]
fn borrow(&self) -> &RelativePath
[src]
Immutably borrows from an owned value. Read more
impl<'a, 'b> PartialEq<RelativePathBuf> for String
[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 PartialEq<RelativePathBuf> 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<'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> 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> PartialEq<RelativePathBuf> for &'a str
[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<'a, 'b> PartialEq<RelativePathBuf> for RelativePath
[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<'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> PartialEq<RelativePathBuf> for &'a RelativePath
[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<'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> PartialEq<RelativePathBuf> for Cow<'a, RelativePath>
[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<'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> PartialEq<RelativePathBuf> for str
[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<'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 Deref for RelativePathBuf
[src]
type Target = RelativePath
The resulting type after dereferencing.
fn deref(&self) -> &RelativePath
[src]
Dereferences the value.
impl Debug for RelativePathBuf
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl Eq for RelativePathBuf
[src]
impl<'de> Deserialize<'de> for RelativePathBuf
[src]
fn deserialize<D>(
deserializer: D
) -> Result<RelativePathBuf, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
deserializer: D
) -> Result<RelativePathBuf, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more