Struct alpm_types::AbsolutePath
source · pub struct AbsolutePath(PathBuf);
Expand description
A representation of an absolute path
AbsolutePath wraps a PathBuf
, that is guaranteed to be absolute.
§Examples
use alpm_types::{AbsolutePath, Error};
use std::str::FromStr;
// create BuildDir from &str
assert_eq!(
AbsolutePath::from_str("/"),
Ok(AbsolutePath::new("/").unwrap())
);
assert_eq!(
AbsolutePath::from_str("./"),
Err(Error::InvalidAbsolutePath(String::from("./")))
);
// format as String
assert_eq!("/", format!("{}", AbsolutePath::new("/").unwrap()));
Tuple Fields§
§0: PathBuf
Implementations§
Trait Implementations§
source§impl Clone for AbsolutePath
impl Clone for AbsolutePath
source§fn clone(&self) -> AbsolutePath
fn clone(&self) -> AbsolutePath
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AbsolutePath
impl Debug for AbsolutePath
source§impl Display for AbsolutePath
impl Display for AbsolutePath
source§impl FromStr for AbsolutePath
impl FromStr for AbsolutePath
source§impl PartialEq for AbsolutePath
impl PartialEq for AbsolutePath
source§fn eq(&self, other: &AbsolutePath) -> bool
fn eq(&self, other: &AbsolutePath) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for AbsolutePath
impl StructuralPartialEq for AbsolutePath
Auto Trait Implementations§
impl Freeze for AbsolutePath
impl RefUnwindSafe for AbsolutePath
impl Send for AbsolutePath
impl Sync for AbsolutePath
impl Unpin for AbsolutePath
impl UnwindSafe for AbsolutePath
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more