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§impl Clone for FileArtifactStore
impl Clone for FileArtifactStore
Source§fn clone(&self) -> FileArtifactStore
fn clone(&self) -> FileArtifactStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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