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§
Sourcefn put(
&self,
write: ArtifactWrite,
) -> ArtifactFuture<'_, Result<ArtifactRef, ArtifactError>>
fn put( &self, write: ArtifactWrite, ) -> ArtifactFuture<'_, Result<ArtifactRef, ArtifactError>>
Idempotently writes content and returns its integrity-bound reference.
Sourcefn get(
&self,
reference: &ArtifactRef,
) -> ArtifactFuture<'_, Result<Artifact, ArtifactError>>
fn get( &self, reference: &ArtifactRef, ) -> ArtifactFuture<'_, Result<Artifact, ArtifactError>>
Loads and verifies one artifact.
Sourcefn list(
&self,
scope: &ArtifactScope,
after: Option<&str>,
limit: u32,
) -> ArtifactFuture<'_, Result<ArtifactPage, ArtifactError>>
fn list( &self, scope: &ArtifactScope, after: Option<&str>, limit: u32, ) -> ArtifactFuture<'_, Result<ArtifactPage, ArtifactError>>
Lists one stable, bounded page inside one scope.
Sourcefn delete(
&self,
scope: &ArtifactScope,
artifact_id: &str,
) -> ArtifactFuture<'_, Result<bool, ArtifactError>>
fn delete( &self, scope: &ArtifactScope, artifact_id: &str, ) -> ArtifactFuture<'_, Result<bool, ArtifactError>>
Idempotently deletes one artifact and its idempotency records.
Sourcefn purge_expired(
&self,
scope: &ArtifactScope,
now_unix_ms: u64,
limit: u32,
) -> ArtifactFuture<'_, Result<u32, ArtifactError>>
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".