pub struct CreateOnlyArtifactSpool { /* private fields */ }Expand description
Create-only local file receiving untrusted artifact bytes.
Implementations§
Source§impl CreateOnlyArtifactSpool
impl CreateOnlyArtifactSpool
Sourcepub fn create(
path: impl Into<Utf8PathBuf>,
) -> Result<Self, SnapshotSessionClientError>
pub fn create( path: impl Into<Utf8PathBuf>, ) -> Result<Self, SnapshotSessionClientError>
Create one new private artifact spool without following an existing path.
§Errors
Rejects non-absolute or unsafe paths, existing destinations, non-files, and failures to prove that the opened handle is the newly linked file.
Sourcepub fn abort(&mut self) -> Result<(), SnapshotSessionClientError>
pub fn abort(&mut self) -> Result<(), SnapshotSessionClientError>
Remove every still-uncommitted identity-matching artifact link.
Calls after successful cleanup are idempotent. A replaced or otherwise unprovable path is preserved and reported instead of being unlinked.
§Errors
Returns SnapshotSessionClientError::ArtifactCleanupFailed when all
operation-owned links cannot be proven removed.
Sourcepub fn commit(&mut self) -> Result<(), SnapshotSessionClientError>
pub fn commit(&mut self) -> Result<(), SnapshotSessionClientError>
Commit the already validated publication after all caller-owned output checks have succeeded.
When the verifier published through a second hard link, this removes only the private staging link. Until this method succeeds, dropping the spool removes both identity-matching links.
§Errors
Rejects calls before a complete session, a replaced publication, byte changes, or a failure to durably remove the private staging link.