Skip to main content

ArtifactService

Trait ArtifactService 

Source
pub trait ArtifactService: Send + Sync {
    // Required methods
    fn save<'life0, 'async_trait>(
        &'life0 self,
        req: SaveRequest,
    ) -> Pin<Box<dyn Future<Output = Result<SaveResponse, AdkError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn load<'life0, 'async_trait>(
        &'life0 self,
        req: LoadRequest,
    ) -> Pin<Box<dyn Future<Output = Result<LoadResponse, AdkError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn delete<'life0, 'async_trait>(
        &'life0 self,
        req: DeleteRequest,
    ) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn list<'life0, 'async_trait>(
        &'life0 self,
        req: ListRequest,
    ) -> Pin<Box<dyn Future<Output = Result<ListResponse, AdkError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn versions<'life0, 'async_trait>(
        &'life0 self,
        req: VersionsRequest,
    ) -> Pin<Box<dyn Future<Output = Result<VersionsResponse, AdkError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;

    // Provided method
    fn health_check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait { ... }
}
Available on crate feature artifacts only.
Expand description

Trait for artifact storage backends.

Implementations must be thread-safe (Send + Sync) and support versioned binary storage scoped by app, user, and session.

Required Methods§

Source

fn save<'life0, 'async_trait>( &'life0 self, req: SaveRequest, ) -> Pin<Box<dyn Future<Output = Result<SaveResponse, AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Store a binary artifact, returning the version that was written.

Source

fn load<'life0, 'async_trait>( &'life0 self, req: LoadRequest, ) -> Pin<Box<dyn Future<Output = Result<LoadResponse, AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Retrieve a stored artifact by filename and optional version.

Source

fn delete<'life0, 'async_trait>( &'life0 self, req: DeleteRequest, ) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Delete an artifact (specific version or all versions).

Source

fn list<'life0, 'async_trait>( &'life0 self, req: ListRequest, ) -> Pin<Box<dyn Future<Output = Result<ListResponse, AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

List all artifact filenames in a session.

Source

fn versions<'life0, 'async_trait>( &'life0 self, req: VersionsRequest, ) -> Pin<Box<dyn Future<Output = Result<VersionsResponse, AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

List all available versions of a specific artifact.

Provided Methods§

Source

fn health_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Verify backend connectivity.

The default implementation succeeds, which is appropriate for in-memory backends.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§