pub struct ArtifactStore { /* private fields */ }Expand description
A content-addressed store of generated outputs, rooted at a directory. The
in-memory index is populated lazily on first access, so read methods take
&mut self.
Implementations§
Source§impl ArtifactStore
impl ArtifactStore
Sourcepub fn store(
&mut self,
draft: ArtifactDraft,
) -> Result<Artifact, ArtifactStoreError>
pub fn store( &mut self, draft: ArtifactDraft, ) -> Result<Artifact, ArtifactStoreError>
Store draft, writing its bytes (deduplicated), optional preview, and a
provenance sidecar, and return the resulting record.
Sourcepub fn list(&mut self) -> Result<Vec<Artifact>, ArtifactStoreError>
pub fn list(&mut self) -> Result<Vec<Artifact>, ArtifactStoreError>
Every artifact, newest first by (created_at, id).
Sourcepub fn get(&mut self, id: &str) -> Result<Option<Artifact>, ArtifactStoreError>
pub fn get(&mut self, id: &str) -> Result<Option<Artifact>, ArtifactStoreError>
The artifact with id, if stored.
Sourcepub fn url(&mut self, id: &str) -> Result<Option<PathBuf>, ArtifactStoreError>
pub fn url(&mut self, id: &str) -> Result<Option<PathBuf>, ArtifactStoreError>
The absolute path to id’s output file, if stored.
Sourcepub fn preview_data(
&mut self,
id: &str,
) -> Result<Option<Vec<u8>>, ArtifactStoreError>
pub fn preview_data( &mut self, id: &str, ) -> Result<Option<Vec<u8>>, ArtifactStoreError>
The bytes of id’s preview, if it has one.
Auto Trait Implementations§
impl Freeze for ArtifactStore
impl RefUnwindSafe for ArtifactStore
impl Send for ArtifactStore
impl Sync for ArtifactStore
impl Unpin for ArtifactStore
impl UnsafeUnpin for ArtifactStore
impl UnwindSafe for ArtifactStore
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