pub struct TempObjDir { /* private fields */ }Expand description
A temporary directory that is exposed as an object store path
This is a wrapper around TempDir that exposes the path as an object store path.
It is useful when you need to create a temporary directory that is only
used as an object store path.
Methods from Deref<Target = ObjPath>§
pub const ROOT: Path
Sourcepub fn parts_count(&self) -> usize
pub fn parts_count(&self) -> usize
Sourcepub fn is_root(&self) -> bool
pub fn is_root(&self) -> bool
True if this Path points to the root of the store, equivalent to Path::from("/").
See also Path::ROOT.
§Example
assert!(Path::from("/").is_root());
assert!(Path::parse("").unwrap().is_root());Sourcepub fn parent(&self) -> Option<Path>
pub fn parent(&self) -> Option<Path>
Returns a copy of this Path with the last path segment removed
Returns None if this path has zero segments.
Sourcepub fn filename(&self) -> Option<&str>
pub fn filename(&self) -> Option<&str>
Returns the last path segment containing the filename stored in this Path
Returns None only if this path is the root path.
Sourcepub fn extension(&self) -> Option<&str>
pub fn extension(&self) -> Option<&str>
Returns the extension of the file stored in this Path, if any
Sourcepub fn prefix_matches(&self, prefix: &Path) -> bool
pub fn prefix_matches(&self, prefix: &Path) -> bool
Returns true if this Path starts with prefix
Trait Implementations§
Source§impl AsRef<Path> for TempObjDir
impl AsRef<Path> for TempObjDir
Source§impl Default for TempObjDir
impl Default for TempObjDir
Auto Trait Implementations§
impl Freeze for TempObjDir
impl RefUnwindSafe for TempObjDir
impl Send for TempObjDir
impl Sync for TempObjDir
impl Unpin for TempObjDir
impl UnsafeUnpin for TempObjDir
impl UnwindSafe for TempObjDir
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more