Struct normpath::BasePathBuf

source ·
pub struct BasePathBuf(/* private fields */);
Expand description

An owned path that has a prefix on Windows.

For more information, see BasePath.

Implementations§

source§

impl BasePathBuf

source

pub fn new<P>(path: P) -> Result<Self>
where P: Into<PathBuf>,

Equivalent to BasePath::new but returns an owned path.

§Examples
use std::path::Path;

use normpath::BasePathBuf;

if cfg!(windows) {
    let path = r"X:\foo\bar";
    assert_eq!(Path::new(path), BasePathBuf::new(path)?);

    assert!(BasePathBuf::new(r"foo\bar").is_ok());
}
source

pub fn try_new<P>(path: P) -> Result<Self, MissingPrefixBufError>
where P: Into<PathBuf>,

Equivalent to BasePath::try_new but returns an owned path.

§Examples
use std::path::Path;

use normpath::BasePathBuf;

if cfg!(windows) {
    let path = r"X:\foo\bar";
    assert_eq!(Path::new(path), BasePathBuf::try_new(path)?);

    assert!(BasePathBuf::try_new(r"foo\bar").is_err());
}
source

pub fn into_os_string(self) -> OsString

Returns the wrapped path as a platform string.

source

pub fn into_path_buf(self) -> PathBuf

Returns the wrapped path.

source

pub fn pop(&mut self) -> Result<bool, ParentError>

Equivalent to BasePath::parent but modifies self in place.

Returns Ok(false) when BasePath::parent returns Ok(None).

§Examples
use std::path::Path;

use normpath::BasePathBuf;

if cfg!(windows) {
    let mut path = BasePathBuf::try_new(r"X:\foo\bar").unwrap();
    assert!(path.pop()?);
    assert_eq!(Path::new(r"X:\foo"), path);
}
source

pub fn pop_unchecked(&mut self) -> bool

Equivalent to PathBuf::pop.

It is usually better to use pop.

§Examples
use std::path::Path;

use normpath::BasePathBuf;

if cfg!(windows) {
    let mut path = BasePathBuf::try_new(r"X:\foo\..").unwrap();
    assert!(path.pop_unchecked());
    assert_eq!(Path::new(r"X:\foo"), path);
}
source

pub fn push<P>(&mut self, path: P)
where P: AsRef<Path>,

Equivalent to BasePath::join but modifies self in place.

§Examples
use std::path::Path;

use normpath::BasePathBuf;

if cfg!(windows) {
    let mut path = BasePathBuf::try_new(r"\\?\foo\bar").unwrap();
    path.push("../baz/test.rs");
    assert_eq!(Path::new(r"\\?\foo\baz\test.rs"), path);
}

Methods from Deref<Target = BasePath>§

source

pub fn as_os_str(&self) -> &OsStr

Returns a reference to the wrapped path as a platform string.

source

pub fn as_path(&self) -> &Path

Returns a reference to the wrapped path.

source

pub fn canonicalize(&self) -> Result<BasePathBuf>

Equivalent to Path::canonicalize.

source

pub fn components(&self) -> Components<'_>

Equivalent to Path::components.

source

pub fn ends_with<P>(&self, child: P) -> bool
where P: AsRef<Path>,

Equivalent to Path::ends_with.

source

pub fn exists(&self) -> bool

Equivalent to Path::exists.

source

pub fn extension(&self) -> Option<&OsStr>

Equivalent to Path::extension.

source

pub fn file_name(&self) -> Option<&OsStr>

Equivalent to Path::file_name.

source

pub fn file_stem(&self) -> Option<&OsStr>

Equivalent to Path::file_stem.

source

pub fn has_root(&self) -> bool

Equivalent to Path::has_root.

source

pub fn is_absolute(&self) -> bool

Equivalent to Path::is_absolute.

source

pub fn is_dir(&self) -> bool

Equivalent to Path::is_dir.

source

pub fn is_file(&self) -> bool

Equivalent to Path::is_file.

source

pub fn is_relative(&self) -> bool

Equivalent to Path::is_relative.

Equivalent to Path::is_symlink.

source

pub fn join<P>(&self, path: P) -> BasePathBuf
where P: AsRef<Path>,

An improved version of Path::join that handles more edge cases.

For example, on Windows, leading . and .. components of path will be normalized if possible. If self is a verbatim path, it would be invalid to normalize them later.

You should still call normalize before parent to normalize some additional components.

§Examples
use std::path::Path;

use normpath::BasePath;

if cfg!(windows) {
    assert_eq!(
        Path::new(r"\\?\foo\baz\test.rs"),
        BasePath::try_new(r"\\?\foo\bar")
            .unwrap()
            .join("../baz/test.rs"),
    );
}
source

pub fn localize_name(&self) -> Cow<'_, OsStr>

Available on crate feature localization only.

Equivalent to PathExt::localize_name.

source

pub fn metadata(&self) -> Result<Metadata>

Equivalent to Path::metadata.

source

pub fn normalize(&self) -> Result<BasePathBuf>

Equivalent to PathExt::normalize.

source

pub fn normalize_virtually(&self) -> Result<BasePathBuf>

Available on Windows only.
source

pub fn parent(&self) -> Result<Option<&Self>, ParentError>

Returns this path without its last component.

Returns Ok(None) if the last component is Component::RootDir.

You should usually only call this method on normalized paths. They will prevent an unexpected path from being returned due to symlinks, and some . and .. components will be normalized.

§Errors

Returns an error if the last component is not Component::Normal or Component::RootDir. To ignore this error, use parent_unchecked.

§Examples
use std::path::Path;

use normpath::BasePath;

if cfg!(windows) {
    assert_eq!(
        Path::new(r"X:\foo"),
        BasePath::try_new(r"X:\foo\bar").unwrap().parent()?.unwrap(),
    );
}
source

pub fn parent_unchecked(&self) -> Option<&Self>

Equivalent to Path::parent.

It is usually better to use parent.

§Examples
use std::path::Path;

use normpath::BasePath;

if cfg!(windows) {
    assert_eq!(
        Path::new(r"X:\foo"),
        BasePath::try_new(r"X:\foo\..")
            .unwrap()
            .parent_unchecked()
            .unwrap(),
    );
}
source

pub fn read_dir(&self) -> Result<ReadDir>

Equivalent to Path::read_dir.

Equivalent to Path::read_link.

source

pub fn starts_with<P>(&self, base: P) -> bool
where P: AsRef<Path>,

Equivalent to Path::starts_with.

Equivalent to Path::symlink_metadata.

source

pub fn try_exists(&self) -> Result<bool>

Equivalent to Path::try_exists.

Trait Implementations§

source§

impl AsRef<BasePath> for BasePathBuf

source§

fn as_ref(&self) -> &BasePath

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<OsStr> for BasePathBuf

source§

fn as_ref(&self) -> &OsStr

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<Path> for BasePathBuf

source§

fn as_ref(&self) -> &Path

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Borrow<BasePath> for BasePathBuf

source§

fn borrow(&self) -> &BasePath

Immutably borrows from an owned value. Read more
source§

impl Clone for BasePathBuf

source§

fn clone(&self) -> BasePathBuf

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BasePathBuf

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for BasePathBuf

§

type Target = BasePath

The resulting type after dereferencing.
source§

fn deref(&self) -> &BasePath

Dereferences the value.
source§

impl<'de> Deserialize<'de> for BasePathBuf

Available on crate feature serde only.
source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<BasePathBuf> for Cow<'_, BasePath>

source§

fn from(value: BasePathBuf) -> Self

Converts to this type from the input type.
source§

impl From<BasePathBuf> for OsString

source§

fn from(value: BasePathBuf) -> Self

Converts to this type from the input type.
source§

impl From<BasePathBuf> for PathBuf

source§

fn from(value: BasePathBuf) -> Self

Converts to this type from the input type.
source§

impl Hash for BasePathBuf

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for BasePathBuf

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<&BasePath> for BasePathBuf

source§

fn eq(&self, other: &&BasePath) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<&Path> for BasePathBuf

source§

fn eq(&self, other: &&Path) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<BasePath> for BasePathBuf

source§

fn eq(&self, other: &BasePath) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<BasePathBuf> for &BasePath

source§

fn eq(&self, other: &BasePathBuf) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<BasePathBuf> for &Path

source§

fn eq(&self, other: &BasePathBuf) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<BasePathBuf> for BasePath

source§

fn eq(&self, other: &BasePathBuf) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<BasePathBuf> for Cow<'_, BasePath>

source§

fn eq(&self, other: &BasePathBuf) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<BasePathBuf> for Cow<'_, Path>

source§

fn eq(&self, other: &BasePathBuf) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<BasePathBuf> for Path

source§

fn eq(&self, other: &BasePathBuf) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<BasePathBuf> for PathBuf

source§

fn eq(&self, other: &BasePathBuf) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Cow<'_, BasePath>> for BasePathBuf

source§

fn eq(&self, other: &Cow<'_, BasePath>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Cow<'_, Path>> for BasePathBuf

source§

fn eq(&self, other: &Cow<'_, Path>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Path> for BasePathBuf

source§

fn eq(&self, other: &Path) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<PathBuf> for BasePathBuf

source§

fn eq(&self, other: &PathBuf) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for BasePathBuf

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<&BasePath> for BasePathBuf

source§

fn partial_cmp(&self, other: &&BasePath) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PartialOrd<&Path> for BasePathBuf

source§

fn partial_cmp(&self, other: &&Path) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PartialOrd<BasePath> for BasePathBuf

source§

fn partial_cmp(&self, other: &BasePath) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PartialOrd<BasePathBuf> for &BasePath

source§

fn partial_cmp(&self, other: &BasePathBuf) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PartialOrd<BasePathBuf> for &Path

source§

fn partial_cmp(&self, other: &BasePathBuf) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PartialOrd<BasePathBuf> for BasePath

source§

fn partial_cmp(&self, other: &BasePathBuf) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PartialOrd<BasePathBuf> for Cow<'_, BasePath>

source§

fn partial_cmp(&self, other: &BasePathBuf) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PartialOrd<BasePathBuf> for Cow<'_, Path>

source§

fn partial_cmp(&self, other: &BasePathBuf) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PartialOrd<BasePathBuf> for Path

source§

fn partial_cmp(&self, other: &BasePathBuf) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PartialOrd<BasePathBuf> for PathBuf

source§

fn partial_cmp(&self, other: &BasePathBuf) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PartialOrd<Cow<'_, BasePath>> for BasePathBuf

source§

fn partial_cmp(&self, other: &Cow<'_, BasePath>) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PartialOrd<Cow<'_, Path>> for BasePathBuf

source§

fn partial_cmp(&self, other: &Cow<'_, Path>) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PartialOrd<Path> for BasePathBuf

source§

fn partial_cmp(&self, other: &Path) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PartialOrd<PathBuf> for BasePathBuf

source§

fn partial_cmp(&self, other: &PathBuf) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PartialOrd for BasePathBuf

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl Quote for BasePathBuf

Available on crate feature uniquote only.
source§

fn escape(&self, f: &mut Formatter<'_>) -> Result

Escapes a string using the format described in the the module-level documentation, without the surrounding quotes. Read more
source§

fn quote(&self) -> Display<&Self>

Quotes a string using the format described in the the module-level documentation. Read more
source§

impl Serialize for BasePathBuf

Available on crate feature serde only.
source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl ToBytes for BasePathBuf

Available on crate feature print_bytes only.
source§

fn to_bytes(&self) -> ByteStr<'_>

Returns a byte string that will be used to represent the instance.
source§

impl Eq for BasePathBuf

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,