pub struct ExistingAbsoluteDir(PathBuf);
Expand description
A path that is guaranteed to be an existing absolute directory.
Tuple Fields§
§0: PathBuf
Implementations§
Source§impl ExistingAbsoluteDir
impl ExistingAbsoluteDir
Sourcepub fn new(path: PathBuf) -> Result<Self, Error>
pub fn new(path: PathBuf) -> Result<Self, Error>
Creates a new ExistingAbsoluteDir
from path
.
Creates a directory at path
if it does not exist yet.
§Errors
Returns an error if
path
is not absolute,path
does not exist and cannot be created,- the metadata of
path
cannot be retrieved, - or
path
is not a directory.
Sourcepub fn as_path(&self) -> &Path
pub fn as_path(&self) -> &Path
Coerces to a Path slice.
Delegates to PathBuf::as_path
.
Sourcepub fn to_path_buf(&self) -> PathBuf
pub fn to_path_buf(&self) -> PathBuf
Converts a Path to an owned PathBuf.
Delegates to Path::to_path_buf
.
Trait Implementations§
Source§impl AsRef<Path> for ExistingAbsoluteDir
impl AsRef<Path> for ExistingAbsoluteDir
Source§impl Clone for ExistingAbsoluteDir
impl Clone for ExistingAbsoluteDir
Source§fn clone(&self) -> ExistingAbsoluteDir
fn clone(&self) -> ExistingAbsoluteDir
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 ExistingAbsoluteDir
impl Debug for ExistingAbsoluteDir
Source§impl From<&OutputDir> for ExistingAbsoluteDir
impl From<&OutputDir> for ExistingAbsoluteDir
Source§impl TryFrom<&Path> for ExistingAbsoluteDir
impl TryFrom<&Path> for ExistingAbsoluteDir
Source§fn try_from(value: &Path) -> Result<Self, Self::Error>
fn try_from(value: &Path) -> Result<Self, Self::Error>
Creates an ExistingAbsoluteDir
from a Path
reference.
Delegates to ExistingAbsoluteDir::new
.
§Errors
Returns an error if ExistingAbsoluteDir::new
fails.
Auto Trait Implementations§
impl Freeze for ExistingAbsoluteDir
impl RefUnwindSafe for ExistingAbsoluteDir
impl Send for ExistingAbsoluteDir
impl Sync for ExistingAbsoluteDir
impl Unpin for ExistingAbsoluteDir
impl UnwindSafe for ExistingAbsoluteDir
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