pub trait ExecutionClientFactory: Debug {
// Required methods
fn create(
&self,
name: &str,
config: &dyn ClientConfig,
cache: CacheView,
) -> 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§
Sourcefn create(
&self,
name: &str,
config: &dyn ClientConfig,
cache: CacheView,
) -> Result<Box<dyn ExecutionClient>>
fn create( &self, name: &str, config: &dyn ClientConfig, cache: CacheView, ) -> Result<Box<dyn ExecutionClient>>
Create a new execution client instance.
Execution clients receive a read-only cache view so venue adapters can query platform state during construction without mutating the cache.
§Errors
Returns an error if client creation fails.
Sourcefn config_type(&self) -> &str
fn config_type(&self) -> &str
Returns the supported configuration type name for this factory.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".