pub struct TempObjFile { /* private fields */ }Expand description
A unique path to a temporary file, exposed as an object store path
Unlike TempFile, this does not create an empty file. We create a
temporary directory and then construct a path inside it, following the
same pattern as TempStdPath. This avoids holding an open file handle,
which on Windows would prevent atomic renames to the same 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 TempObjFile
impl AsRef<Path> for TempObjFile
Source§impl Default for TempObjFile
impl Default for TempObjFile
Auto Trait Implementations§
impl Freeze for TempObjFile
impl RefUnwindSafe for TempObjFile
impl Send for TempObjFile
impl Sync for TempObjFile
impl Unpin for TempObjFile
impl UnsafeUnpin for TempObjFile
impl UnwindSafe for TempObjFile
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
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>
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>
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