Skip to main content

ArtifactBackend

Trait ArtifactBackend 

Source
pub trait ArtifactBackend: Send + Sync {
    // Required methods
    fn put(&self, name: &str, data: &[u8]) -> Result<String>;
    fn get(&self, hash: &str) -> Result<Vec<u8>>;
    fn exists(&self, hash: &str) -> Result<bool>;
    fn delete(&self, hash: &str) -> Result<()>;
    fn get_metadata(&self, hash: &str) -> Result<ArtifactMetadata>;
    fn list(&self) -> Result<Vec<ArtifactMetadata>>;
    fn backend_type(&self) -> &'static str;
}
Expand description

Trait for artifact storage backends

Required Methods§

Source

fn put(&self, name: &str, data: &[u8]) -> Result<String>

Store an artifact and return its content-addressable hash

Source

fn get(&self, hash: &str) -> Result<Vec<u8>>

Retrieve an artifact by hash

Source

fn exists(&self, hash: &str) -> Result<bool>

Check if an artifact exists

Source

fn delete(&self, hash: &str) -> Result<()>

Delete an artifact by hash

Source

fn get_metadata(&self, hash: &str) -> Result<ArtifactMetadata>

Get artifact metadata

Source

fn list(&self) -> Result<Vec<ArtifactMetadata>>

List all artifacts

Source

fn backend_type(&self) -> &'static str

Get backend type name

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§