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