Trait ExecutionClientFactory

Source
pub trait ExecutionClientFactory:
    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 ExecutionClient>>;
    fn name(&self) -> &str;
    fn config_type(&self) -> &str;
}
Expand description

Factory trait for creating execution client instances.

Implementations of this trait should create specific execution client types (e.g., Binance, Bybit, Interactive Brokers) 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 ExecutionClient>>

Create a new execution 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§