Skip to main content

SeedManager

Trait SeedManager 

Source
pub trait SeedManager: Send + Sync {
    // Required methods
    fn seed_init<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<SeedStatus, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn seed_refresh<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: Option<&'life1 str>,
    ) -> Pin<Box<dyn Future<Output = Result<SeedStatus, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn seed_status<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<SeedStatus, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn seed_check_remote<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: Option<&'life1 str>,
    ) -> Pin<Box<dyn Future<Output = Result<SeedStatus, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Seed data manager — initializes and refreshes reference data.

Seed data includes providers, models, channels, and model mappings with pricing. It is versioned separately from schema migrations so it can be hot-updated without redeploying.

Required Methods§

Source

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

Initialize seed data from the embedded fallback (compile-time JSON).

Idempotent — safe to call on every startup. Only inserts when the local database has no seed data yet (version = 0).

Source

fn seed_refresh<'life0, 'life1, 'async_trait>( &'life0 self, url: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<SeedStatus, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch and apply seed data from a remote URL.

url is the base URL to the seed directory (e.g. "https://raw.githubusercontent.com/.../refs/tags/seed-v3/crates/storage-sqlite/seed/"). When None, tries the environment variable AGENT_PROXY_SEED_URL, then falls back to the last-used URL stored in seed_metadata.

Source

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

Query the current seed data status without fetching.

Source

fn seed_check_remote<'life0, 'life1, 'async_trait>( &'life0 self, url: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<SeedStatus, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch the remote manifest and compare with local status, but do NOT apply any changes. Used by the admin API ?remote=true query parameter.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§