Skip to main content

CacheDatabaseFactory

Trait CacheDatabaseFactory 

Source
pub trait CacheDatabaseFactory:
    Debug
    + Send
    + Sync {
    // Required method
    fn create<'life0, 'async_trait>(
        &'life0 self,
        trader_id: TraderId,
        instance_id: UUID4,
        config: CacheConfig,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn CacheDatabaseAdapter>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Factory for constructing cache database adapters at runtime.

Implementations own the concrete database configuration and return the transport-neutral CacheDatabaseAdapter surface used by the cache.

Required Methods§

Source

fn create<'life0, 'async_trait>( &'life0 self, trader_id: TraderId, instance_id: UUID4, config: CacheConfig, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn CacheDatabaseAdapter>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates a cache database adapter for the given cache runtime.

§Errors

Returns an error if adapter construction or connection setup fails.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§