Skip to main content

ProviderDataLoader

Trait ProviderDataLoader 

Source
pub trait ProviderDataLoader:
    Send
    + Sync
    + Sized {
    // Required methods
    fn new<'async_trait>(    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn load_entries(
        &self,
    ) -> Pin<Box<dyn Stream<Item = Result<UsageEntry>> + Send + '_>>;
}
Expand description

Trait for provider-specific data loaders.

Each provider crate (Claude, Codex, OpenCode, Amp, Pi) implements this trait so that the main binary can dispatch to any provider using generic code.

Required Methods§

Source

fn new<'async_trait>() -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: 'async_trait,

Create a new data loader, discovering data directories.

Source

fn load_entries( &self, ) -> Pin<Box<dyn Stream<Item = Result<UsageEntry>> + Send + '_>>

Stream all usage entries from the provider’s data files.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§