pub struct HistoryOpts {
pub window: Option<Duration>,
pub max_rate_waits: u32,
pub max_rate_wait: Duration,
pub transport_retries: u32,
pub transport_backoff: Duration,
}Expand description
How CandlePages cuts the range and how patient it is.
§Examples
use std::time::Duration;
use brokapi_runtime::history::HistoryOpts;
let opts = HistoryOpts { max_rate_waits: 20, ..HistoryOpts::default() };
assert_eq!(opts.window, None);
assert_eq!(opts.max_rate_wait, Duration::from_secs(60));Fields§
§window: Option<Duration>The span of one request. None: take [MarketDataSource::candles_max_span], and when the
connector does not know it, read the whole range in one request.
max_rate_waits: u32How many times one window waits out [Error::RateLimited] before the error is returned.
Default 10.
max_rate_wait: DurationThe longest single pause on [Error::RateLimited]. The pause is the retry_after of the
error, cut to this value. Default 60 seconds.
transport_retries: u32How many times one window is read again after [Error::Transport]. Default 2.
transport_backoff: DurationThe pause before the first repeat after [Error::Transport]. It doubles for each next
repeat. Default 1 second.
Trait Implementations§
Source§impl Clone for HistoryOpts
impl Clone for HistoryOpts
Source§fn clone(&self) -> HistoryOpts
fn clone(&self) -> HistoryOpts
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HistoryOpts
Source§impl Debug for HistoryOpts
impl Debug for HistoryOpts
Source§impl Default for HistoryOpts
impl Default for HistoryOpts
impl Eq for HistoryOpts
Source§impl PartialEq for HistoryOpts
impl PartialEq for HistoryOpts
Source§fn eq(&self, other: &HistoryOpts) -> bool
fn eq(&self, other: &HistoryOpts) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for HistoryOpts
Auto Trait Implementations§
impl Freeze for HistoryOpts
impl RefUnwindSafe for HistoryOpts
impl Send for HistoryOpts
impl Sync for HistoryOpts
impl Unpin for HistoryOpts
impl UnsafeUnpin for HistoryOpts
impl UnwindSafe for HistoryOpts
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.