[][src]Struct pathdiv::pathdiv::PathDiv

pub struct 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]

type Target = Path

The resulting type after dereferencing.

impl Display for PathDiv[src]

impl<T> Div<T> for PathDiv where
    T: AsRef<Path> + Sized
[src]

type Output = Self

The resulting type after applying the / operator.

impl<'_, T> Div<T> for &'_ PathDiv where
    T: AsRef<Path> + Sized
[src]

type Output = PathDiv

The resulting type after applying the / operator.

impl<T> DivAssign<T> for PathDiv where
    T: AsRef<Path> + Sized
[src]

impl Eq for PathDiv[src]

impl<P: AsRef<Path>> Extend<P> for PathDiv[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]

fn from(boxed: Box<Path>) -> PathDiv[src]

Converts a Box<Path> into a PathDiv

impl<'a> From<Cow<'a, Path>> for PathDiv[src]

impl From<OsString> for PathDiv[src]

fn from(s: OsString) -> PathDiv[src]

Converts a OsString into a PathDiv

impl From<PathDiv> for Box<Path>[src]

fn from(p: PathDiv) -> Box<Path>[src]

Converts a PathDiv into a Box<Path>

impl From<PathDiv> for OsString[src]

fn from(path_buf: PathDiv) -> OsString[src]

Converts a PathDiv into a OsString

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]

fn from(s: String) -> PathDiv[src]

Converts a String into a PathBuf

impl<P: AsRef<Path>> FromIterator<P> for PathDiv[src]

impl FromStr for PathDiv[src]

type Err = Infallible

The associated error which can be returned from parsing.

impl Hash for PathDiv[src]

impl Ord for PathDiv[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]

impl<'a, 'b> PartialEq<Cow<'a, Path>> for PathDiv[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]

impl<'a, 'b> PartialOrd<&'a Path> for PathDiv[src]

impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for PathDiv[src]

impl<'a, 'b> PartialOrd<Cow<'a, Path>> for PathDiv[src]

impl<'a, 'b> PartialOrd<OsStr> for PathDiv[src]

impl<'a, 'b> PartialOrd<OsString> for PathDiv[src]

impl<'a, 'b> PartialOrd<Path> for PathDiv[src]

impl PartialOrd<PathDiv> for PathDiv[src]

impl<'a, 'b> PartialOrd<PathDiv> for OsStr[src]

impl<'a, 'b> PartialOrd<PathDiv> for &'a OsStr[src]

impl<'a, 'b> PartialOrd<PathDiv> for Cow<'a, OsStr>[src]

impl<'a, 'b> PartialOrd<PathDiv> for OsString[src]

impl<'a, 'b> PartialOrd<PathDiv> for Path[src]

impl<'a, 'b> PartialOrd<PathDiv> for &'a Path[src]

impl<'a, 'b> PartialOrd<PathDiv> for Cow<'a, Path>[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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.