pub struct FileArtifactStore { /* private fields */ }Expand description
Filesystem ArtifactStore: one file per artifact at
{dir}/{sha256}, written with the same atomic temp-write-then-rename
discipline the JSON-file checkpointer uses — a crash mid-write can never
leave a truncated blob behind (and a truncated blob would be caught by
the read-side integrity check anyway).
Implementations§
Trait Implementations§
Source§impl ArtifactStore for FileArtifactStore
impl ArtifactStore for FileArtifactStore
Source§fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
bytes: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<ArtifactRef>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
bytes: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<ArtifactRef>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store
bytes, returning their content address. Idempotent: storing
identical bytes twice yields the same address and (at most) one
stored object.Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
sha256: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
sha256: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch the bytes for a content address. Integrity is verified on
every read: the returned bytes re-hash to the requested address, or
this errors — a store that cannot prove its bytes are the addressed
bytes is corruption, not data.
Source§fn contains<'life0, 'life1, 'async_trait>(
&'life0 self,
sha256: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn contains<'life0, 'life1, 'async_trait>(
&'life0 self,
sha256: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Whether the store holds an address (existence only, no integrity
check — use
ArtifactStore::get when the bytes matter).Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
sha256: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
sha256: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove the bytes behind an address (R0.12 Operations Plane, wave
2 — the retention sweeper’s mechanism).
true when the address
was present, false when it was already gone, so a retried prune
converges. The trait provides the mechanism only; the policy —
which addresses may be pruned, and which a live receipt still
pins — belongs to the caller, because deleting bytes a recorded
run or a signed receipt still names is an evidence decision, not
a storage detail.Source§impl Clone for FileArtifactStore
impl Clone for FileArtifactStore
Auto Trait Implementations§
impl Freeze for FileArtifactStore
impl RefUnwindSafe for FileArtifactStore
impl Send for FileArtifactStore
impl Sync for FileArtifactStore
impl Unpin for FileArtifactStore
impl UnsafeUnpin for FileArtifactStore
impl UnwindSafe for FileArtifactStore
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