pub struct Parent(/* private fields */);
Expand description
Parent path, gracefully handling relative path inputs
Implementations§
Source§impl Parent
impl Parent
Sourcepub fn of(p: &Path) -> Option<Self>
pub fn of(p: &Path) -> Option<Self>
Create from a Path
, falling back to the
current_dir()
if necessary.
Returns None
if there is no parent (that is we are /
).
Sourcepub fn current_dir() -> Self
pub fn current_dir() -> Self
Creates a Parent
that is the current directory.
Asks the operating system for the path.
Sourcepub fn from_parent_path_buf(buf: PathBuf) -> Self
pub fn from_parent_path_buf(buf: PathBuf) -> Self
Convert from a PathBuf
that is already a parent.
pub fn as_path_buf(&self) -> &PathBuf
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Parent
impl RefUnwindSafe for Parent
impl Send for Parent
impl Sync for Parent
impl Unpin for Parent
impl UnwindSafe for Parent
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