#[non_exhaustive]pub struct Config {Show 25 fields
pub base_url: String,
pub wss_url: String,
pub timeout: Duration,
pub total_timeout: Option<Duration>,
pub max_retries: u32,
pub retry_base_delay: Duration,
pub retry_max_delay: Duration,
pub retry_on_burst: RetryOnBurst,
pub burst_wait: Duration,
pub max_pages: u32,
pub max_response_bytes: usize,
pub ping_interval: Duration,
pub watchdog_timeout: Duration,
pub rotation_interval: Duration,
pub reconnect_base_delay: Duration,
pub reconnect_max_delay: Duration,
pub long_backoff: Duration,
pub quota_reconnect: bool,
pub quota_reconnect_interval: Duration,
pub search_failed_threshold: u32,
pub dedupe_cache_size: usize,
pub max_message_bytes: usize,
pub connect_timeout: Duration,
pub http_client: Option<Client>,
pub ws_connector: Option<Arc<dyn WsConnector>>,
/* private fields */
}Expand description
Configuration of a Client. Build it with Config::builder.
Durations are std::time::Duration. Every value can be overridden.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.base_url: StringREST base URL. Default https://api.finlight.me.
wss_url: StringWebSocket URL. Default wss://wss.finlight.me; the raw stream uses <wss_url>/raw.
timeout: DurationTimeout of one REST attempt. Default 30 s. Ignored with your own http_client.
total_timeout: Option<Duration>Upper bound of one REST call, retries and burst wait included. Default none.
max_retries: u32Retries after the first attempt for 5xx, network errors and attempt timeouts. Default 3.
retry_base_delay: DurationFirst backoff delay. Default 0.5 s.
retry_max_delay: DurationLargest backoff delay. Default 8 s.
retry_on_burst: RetryOnBurstBehaviour on a 429 burst. Default RetryOnBurst::Once.
burst_wait: DurationWait on a 429 burst without Retry-After. Default 10 s.
max_pages: u32Page limit of search_all. Default 10.
max_response_bytes: usizeLargest REST response body read. Default 32 MiB.
ping_interval: DurationInterval of the application ping on streams. Default 25 s.
watchdog_timeout: DurationA stream connection without a pong for this long is replaced. Default 60 s.
rotation_interval: DurationA stream connection is renewed after this long (the gateway ends it after 2 h). Default 115 min.
reconnect_base_delay: DurationFirst reconnect delay of a stream. Default 1 s.
reconnect_max_delay: DurationLargest reconnect delay. Default 30 s.
long_backoff: DurationWait after a refused dial because of the connection limit. Default 60 s.
quota_reconnect: boolWhen the WebSocket quota is used up, keep the stream and redial every
quota_reconnect_interval. false ends the stream with the error. Default true.
quota_reconnect_interval: DurationInterval of quota redials. Default 1 h.
search_failed_threshold: u32After this many SEARCH_FAILED in a row, the error goes to on_error. Default 5.
dedupe_cache_size: usizeEntries of the duplicate filter of each stream. Default 1000.
max_message_bytes: usizeLargest incoming stream message. Default 32 MiB.
connect_timeout: DurationTimeout of the WebSocket dial and handshake. Default 30 s.
http_client: Option<Client>Your own reqwest::Client for REST. Its own timeouts apply; the SDK never closes it.
ws_connector: Option<Arc<dyn WsConnector>>Your own transport for WebSocket dials (e.g. through a proxy).