pub struct CoinApiDataClientConfig {Show 15 fields
pub api_key: Option<SecretString>,
pub base_url_http: Option<String>,
pub base_url_ws: Option<String>,
pub proxy_url: Option<SecretString>,
pub instruments: Vec<CoinApiInstrumentSelection>,
pub credit_budget: u64,
pub max_retries: u32,
pub http_timeout_secs: u64,
pub max_concurrent_requests: usize,
pub retry_delay_initial_ms: u64,
pub retry_delay_max_ms: u64,
pub retry_max_elapsed_ms: u64,
pub transport_backend: TransportBackend,
pub book_snapshot_timeout_secs: u64,
pub price_precisions: HashMap<InstrumentId, u8>,
}Expand description
Configuration for CoinApiDataClient.
Fields§
§api_key: Option<SecretString>API key; None falls back to the COINAPI_API_KEY environment variable.
base_url_http: Option<String>Optional override for the REST base URL, including its version prefix.
base_url_ws: Option<String>Optional override for the WebSocket URL.
proxy_url: Option<SecretString>Optional explicit proxy URL for HTTP and WebSocket transports.
instruments: Vec<CoinApiInstrumentSelection>Instruments loaded on connect and served by instrument requests.
credit_budget: u64Conservative lifetime REST credit allowance for this client; see CoinApiHttpConfig.
max_retries: u32Maximum retries for a failed REST request.
http_timeout_secs: u64Positive per-attempt REST timeout in seconds, including concurrency admission.
max_concurrent_requests: usizeMaximum simultaneous REST requests for this client instance.
retry_delay_initial_ms: u64Initial REST retry delay in milliseconds.
retry_delay_max_ms: u64Maximum REST retry backoff in milliseconds; provider retry delays can exceed it.
retry_max_elapsed_ms: u64Positive total REST elapsed budget in milliseconds, including admission and retries.
transport_backend: TransportBackendWebSocket transport backend.
book_snapshot_timeout_secs: u64Seconds to wait for an order book snapshot after a subscription, reconnect, or recovery request; zero disables the deadline.
price_precisions: HashMap<InstrumentId, u8>Price precision by selected instrument, replacing the CoinAPI price resolution when it is coarser than the prices the venue quotes.
Implementations§
Source§impl CoinApiDataClientConfig
impl CoinApiDataClientConfig
Sourcepub fn builder() -> CoinApiDataClientConfigBuilder
pub fn builder() -> CoinApiDataClientConfigBuilder
Create an instance of CoinApiDataClientConfig using the builder syntax
Source§impl CoinApiDataClientConfig
impl CoinApiDataClientConfig
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validates the configured instrument selections.
§Errors
Returns an error if a selection lists no instruments, instrument IDs repeat, or an instrument does not map to the selected exchange.
Sourcepub fn http_config(&self) -> CoinApiHttpConfig
pub fn http_config(&self) -> CoinApiHttpConfig
Returns the REST transport configuration, applying overrides to the defaults.
Sourcepub fn websocket_config(&self) -> CoinApiWebSocketConfig
pub fn websocket_config(&self) -> CoinApiWebSocketConfig
Returns the WebSocket transport configuration, applying overrides to the defaults.