Skip to main content

AssetSource

Trait AssetSource 

Source
pub trait AssetSource {
    type Error: Error + Send + Sync + 'static;
    type Index: VectorIndex;

    // Required methods
    fn read_plaintext(&self, asset_id: &Uuid) -> Result<Vec<u8>, Self::Error>;
    fn vector_index(&self) -> &Self::Index;
}
Expand description

The store the orchestrator reads asset pixels from and indexes vectors into.

Implemented by Workspace; a test double only has to produce bytes for an id and hand back a catalog. Keeping it a trait is what removes the ml -> lifecycle import (see the module docs).

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

How this store reports a failed read. Type-erased into StoreError on the way out, so ml never names a concrete store error.

Source

type Index: VectorIndex

The vector index this store’s embeddings live in.

Required Methods§

Source

fn read_plaintext(&self, asset_id: &Uuid) -> Result<Vec<u8>, Self::Error>

The decoded-asset plaintext bytes inference runs over.

Source

fn vector_index(&self) -> &Self::Index

The catalog holding this store’s vector index.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§