[−][src]Struct pathdiv::pathdiv::PathDiv
This library provides an API similar to pathlib of python.
"/" can be used to join the path.
PathDiv
is a wrapper for PathBuf
.
Examples
use pathdiv::PathDiv; let mut path = PathDiv::from("/etc"); path = path / "init.d"; path /= "ssh"; println!("{}", path); // "/etc/init.d/ssh"
Implementations
impl PathDiv
[src]
pub fn new() -> PathDiv
[src]
pub fn as_path(&self) -> &Path
[src]
pub fn push<P: AsRef<Path>>(&mut self, path: P)
[src]
pub fn pop(&mut self) -> bool
[src]
pub fn set_file_name<S: AsRef<OsStr>>(&mut self, file_name: S)
[src]
pub fn set_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> bool
[src]
pub fn into_os_string(self) -> OsString
[src]
pub fn into_boxed_path(self) -> Box<Path>
[src]
Trait Implementations
impl AsRef<OsStr> for PathDiv
[src]
impl AsRef<Path> for PathDiv
[src]
impl Borrow<Path> for PathDiv
[src]
impl Clone for PathDiv
[src]
impl Debug for PathDiv
[src]
impl Default for PathDiv
[src]
impl Deref for PathDiv
[src]
impl Display for PathDiv
[src]
impl<T> Div<T> for PathDiv where
T: AsRef<Path> + Sized,
[src]
T: AsRef<Path> + Sized,
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: T) -> Self::Output
[src]
impl<'_, T> Div<T> for &'_ PathDiv where
T: AsRef<Path> + Sized,
[src]
T: AsRef<Path> + Sized,
type Output = PathDiv
The resulting type after applying the /
operator.
fn div(self, rhs: T) -> Self::Output
[src]
impl<T> DivAssign<T> for PathDiv where
T: AsRef<Path> + Sized,
[src]
T: AsRef<Path> + Sized,
fn div_assign(&mut self, rhs: T)
[src]
impl Eq for PathDiv
[src]
impl<P: AsRef<Path>> Extend<P> for PathDiv
[src]
fn extend<I: IntoIterator<Item = P>>(&mut self, iter: I)
[src]
impl<'_, T: ?Sized + AsRef<OsStr>> From<&'_ T> for PathDiv
[src]
impl<'a> From<&'a PathDiv> for Cow<'a, Path>
[src]
impl From<Box<Path>> for PathDiv
[src]
impl<'a> From<Cow<'a, Path>> for PathDiv
[src]
impl From<OsString> for PathDiv
[src]
impl From<PathDiv> for Box<Path>
[src]
impl From<PathDiv> for OsString
[src]
impl From<PathDiv> for Arc<Path>
[src]
fn from(s: PathDiv) -> Arc<Path>
[src]
Converts a PathDiv
into an Arc
by moving the PathBuf
data into a new Arc
buffer.
impl From<PathDiv> for Rc<Path>
[src]
fn from(s: PathDiv) -> Rc<Path>
[src]
Converts a PathBuf
into an Rc
by moving the PathBuf
data into a new Rc
buffer.
impl From<String> for PathDiv
[src]
impl<P: AsRef<Path>> FromIterator<P> for PathDiv
[src]
fn from_iter<I: IntoIterator<Item = P>>(iter: I) -> PathDiv
[src]
impl FromStr for PathDiv
[src]
type Err = Infallible
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for PathDiv
[src]
fn hash<H: Hasher>(&self, h: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for PathDiv
[src]
fn cmp(&self, other: &PathDiv) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<'a, 'b> PartialEq<&'a OsStr> for PathDiv
[src]
impl<'a, 'b> PartialEq<&'a Path> for PathDiv
[src]
impl<'a, 'b> PartialEq<Cow<'a, OsStr>> for PathDiv
[src]
fn eq(&self, other: &Cow<'a, OsStr>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b> PartialEq<Cow<'a, Path>> for PathDiv
[src]
fn eq(&self, other: &Cow<'a, Path>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b> PartialEq<OsStr> for PathDiv
[src]
impl<'a, 'b> PartialEq<OsString> for PathDiv
[src]
impl<'a, 'b> PartialEq<Path> for PathDiv
[src]
impl PartialEq<PathDiv> for PathDiv
[src]
impl<'a, 'b> PartialEq<PathDiv> for OsStr
[src]
impl<'a, 'b> PartialEq<PathDiv> for &'a OsStr
[src]
impl<'a, 'b> PartialEq<PathDiv> for Cow<'a, OsStr>
[src]
impl<'a, 'b> PartialEq<PathDiv> for OsString
[src]
impl<'a, 'b> PartialEq<PathDiv> for Path
[src]
impl<'a, 'b> PartialEq<PathDiv> for &'a Path
[src]
impl<'a, 'b> PartialEq<PathDiv> for Cow<'a, Path>
[src]
impl<'a, 'b> PartialOrd<&'a OsStr> for PathDiv
[src]
fn partial_cmp(&self, other: &&'a OsStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b> PartialOrd<&'a Path> for PathDiv
[src]
fn partial_cmp(&self, other: &&'a Path) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for PathDiv
[src]
fn partial_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for PathDiv
[src]
fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b> PartialOrd<OsStr> for PathDiv
[src]
fn partial_cmp(&self, other: &OsStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b> PartialOrd<OsString> for PathDiv
[src]
fn partial_cmp(&self, other: &OsString) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b> PartialOrd<Path> for PathDiv
[src]
fn partial_cmp(&self, other: &Path) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<PathDiv> for PathDiv
[src]
fn partial_cmp(&self, other: &PathDiv) -> Option<Ordering>
[src]
fn lt(&self, other: &PathDiv) -> bool
[src]
fn le(&self, other: &PathDiv) -> bool
[src]
fn gt(&self, other: &PathDiv) -> bool
[src]
fn ge(&self, other: &PathDiv) -> bool
[src]
impl<'a, 'b> PartialOrd<PathDiv> for OsStr
[src]
fn partial_cmp(&self, other: &PathDiv) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b> PartialOrd<PathDiv> for &'a OsStr
[src]
fn partial_cmp(&self, other: &PathDiv) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b> PartialOrd<PathDiv> for Cow<'a, OsStr>
[src]
fn partial_cmp(&self, other: &PathDiv) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b> PartialOrd<PathDiv> for OsString
[src]
fn partial_cmp(&self, other: &PathDiv) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b> PartialOrd<PathDiv> for Path
[src]
fn partial_cmp(&self, other: &PathDiv) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b> PartialOrd<PathDiv> for &'a Path
[src]
fn partial_cmp(&self, other: &PathDiv) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, 'b> PartialOrd<PathDiv> for Cow<'a, Path>
[src]
fn partial_cmp(&self, other: &PathDiv) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for PathDiv
[src]
impl StructuralPartialEq for PathDiv
[src]
Auto Trait Implementations
impl RefUnwindSafe for PathDiv
impl Send for PathDiv
impl Sync for PathDiv
impl Unpin for PathDiv
impl UnwindSafe for PathDiv
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,