Trait DataClientFactory

Source
pub trait DataClientFactory:
    Send
    + Sync
    + Debug {
    // Required methods
    fn create(
        &self,
        name: &str,
        config: &dyn ClientConfig,
        cache: Rc<RefCell<Cache>>,
        clock: Rc<RefCell<dyn Clock>>,
    ) -> Result<Box<dyn DataClient>>;
    fn name(&self) -> &str;
    fn config_type(&self) -> &str;
}
Expand description

Factory trait for creating data client instances.

Implementations of this trait should create specific data client types (e.g., Binance, Bybit, Databento) based on the provided configuration.

Required Methods§

Source

fn create( &self, name: &str, config: &dyn ClientConfig, cache: Rc<RefCell<Cache>>, clock: Rc<RefCell<dyn Clock>>, ) -> Result<Box<dyn DataClient>>

Create a new data client instance.

§Errors

Returns an error if client creation fails.

Source

fn name(&self) -> &str

Returns the name of this factory.

Source

fn config_type(&self) -> &str

Returns the supported configuration type name for this factory.

Implementors§