Skip to main content

ArtifactStore

Trait ArtifactStore 

Source
pub trait ArtifactStore: Send + Sync {
    // Required methods
    fn put(
        &self,
        write: ArtifactWrite,
    ) -> ArtifactFuture<'_, Result<ArtifactRef, ArtifactError>>;
    fn get(
        &self,
        reference: &ArtifactRef,
    ) -> ArtifactFuture<'_, Result<Artifact, ArtifactError>>;
    fn list(
        &self,
        scope: &ArtifactScope,
        after: Option<&str>,
        limit: u32,
    ) -> ArtifactFuture<'_, Result<ArtifactPage, ArtifactError>>;
    fn delete(
        &self,
        scope: &ArtifactScope,
        artifact_id: &str,
    ) -> ArtifactFuture<'_, Result<bool, ArtifactError>>;
    fn purge_expired(
        &self,
        scope: &ArtifactScope,
        now_unix_ms: u64,
        limit: u32,
    ) -> ArtifactFuture<'_, Result<u32, ArtifactError>>;
}
Expand description

Binary artifact persistence boundary.

Required Methods§

Source

fn put( &self, write: ArtifactWrite, ) -> ArtifactFuture<'_, Result<ArtifactRef, ArtifactError>>

Idempotently writes content and returns its integrity-bound reference.

Source

fn get( &self, reference: &ArtifactRef, ) -> ArtifactFuture<'_, Result<Artifact, ArtifactError>>

Loads and verifies one artifact.

Source

fn list( &self, scope: &ArtifactScope, after: Option<&str>, limit: u32, ) -> ArtifactFuture<'_, Result<ArtifactPage, ArtifactError>>

Lists one stable, bounded page inside one scope.

Source

fn delete( &self, scope: &ArtifactScope, artifact_id: &str, ) -> ArtifactFuture<'_, Result<bool, ArtifactError>>

Idempotently deletes one artifact and its idempotency records.

Source

fn purge_expired( &self, scope: &ArtifactScope, now_unix_ms: u64, limit: u32, ) -> ArtifactFuture<'_, Result<u32, ArtifactError>>

Deletes at most limit expired artifacts in one scope.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> ArtifactStore for Arc<T>
where T: ArtifactStore + ?Sized,

Source§

fn put( &self, write: ArtifactWrite, ) -> ArtifactFuture<'_, Result<ArtifactRef, ArtifactError>>

Source§

fn get( &self, reference: &ArtifactRef, ) -> ArtifactFuture<'_, Result<Artifact, ArtifactError>>

Source§

fn list( &self, scope: &ArtifactScope, after: Option<&str>, limit: u32, ) -> ArtifactFuture<'_, Result<ArtifactPage, ArtifactError>>

Source§

fn delete( &self, scope: &ArtifactScope, artifact_id: &str, ) -> ArtifactFuture<'_, Result<bool, ArtifactError>>

Source§

fn purge_expired( &self, scope: &ArtifactScope, now_unix_ms: u64, limit: u32, ) -> ArtifactFuture<'_, Result<u32, ArtifactError>>

Implementors§