Skip to main content

ArtifactStore

Trait ArtifactStore 

Source
pub trait ArtifactStore:
    Send
    + Sync
    + 'static {
    // Required methods
    fn load_all(&self) -> Result<Vec<(ArtifactKey, StoredArtifact)>>;
    fn load(&self, key: &ArtifactKey) -> Result<Option<StoredArtifact>>;
    fn store(
        &self,
        key: &ArtifactKey,
        manifest: &ArtifactManifest,
        dylib_bytes: &[u8],
    ) -> Result<()>;
    fn delete(&self, key: &ArtifactKey) -> Result<()>;
    fn clear(&self) -> Result<()>;
}
Expand description

Trait for loading and storing compiled artifacts.

Implementations manage artifact files on the filesystem. The store owns the dylib files and returns paths to them. The backend loads shared libraries directly from these paths.

Required Methods§

Source

fn load_all(&self) -> Result<Vec<(ArtifactKey, StoredArtifact)>>

Loads all available artifacts from storage.

Source

fn load(&self, key: &ArtifactKey) -> Result<Option<StoredArtifact>>

Loads a single artifact by key.

Source

fn store( &self, key: &ArtifactKey, manifest: &ArtifactManifest, dylib_bytes: &[u8], ) -> Result<()>

Stores an artifact. The dylib_bytes are the raw shared-library bytes to persist. The store writes them to disk and the returned path (via subsequent load) points there.

Source

fn delete(&self, key: &ArtifactKey) -> Result<()>

Deletes an artifact by key.

Source

fn clear(&self) -> Result<()>

Clears all stored artifacts.

Implementors§