pub struct ArtifactStagingDirectory { /* private fields */ }Expand description
Temporary artifact directory retained until its owner is closed or dropped.
The caller keeps custody of the parent and allocated child against unrelated
writers. Drop performs best-effort cleanup of this invocation-owned child;
use Self::close when cleanup failures must reach the caller. No shared
cache entry is created, reused or removed.
Implementations§
Source§impl ArtifactStagingDirectory
impl ArtifactStagingDirectory
Sourcepub fn new(parent: &Path) -> Result<Self>
pub fn new(parent: &Path) -> Result<Self>
Allocate a distinct staging child beneath an existing caller-owned directory.
The parent is not created. Existing children are never reused or removed.
§Errors
Returns the filesystem error for a missing or unwritable parent, or
AlreadyExists when every allocation attempt collides.
Sourcepub fn path(&self) -> &Path
pub fn path(&self) -> &Path
Borrow the owned staging directory through artifact production and consumption.
Sourcepub fn close(self) -> Result<()>
pub fn close(self) -> Result<()>
Remove this owned staging child, reporting cleanup failure without a hidden retry.
On failure, the caller owns recovery of the remaining staging child. It does not remove the parent or any other artifact directory.
§Errors
Returns the filesystem error if removing the owned child fails.