Struct MarketDataConfig
pub struct MarketDataConfig {
pub bybit: BybitConfig,
pub source: Arc<str>,
pub reconnect_min: Duration,
pub reconnect_max: Duration,
pub subscribe_ack_timeout: Duration,
}Expand description
Settings of MarketDataConnector.
§Examples
use std::time::Duration;
use brokapi_bybit_protocol::config::BybitConfig;
use brokapi_bybit::MarketDataConfig;
let mut cfg = MarketDataConfig::new(BybitConfig::new("key", "secret"), "bybit-md");
assert_eq!(&*cfg.source, "bybit-md");
// Wait at most 10 seconds between reconnects instead of the default 30.
cfg.reconnect_max = Duration::from_secs(10);Fields§
§bybit: BybitConfigClient settings of the Bybit API: key pair, contour, receive window, endpoints.
source: Arc<str>Envelope source label, e.g. "bybit-md".
reconnect_min: DurationPause before the first reconnect of the WebSocket, doubling up to reconnect_max (default 0.5 s, as at
the other brokers).
reconnect_max: DurationUpper bound of the pause (default 30 s). The pause returns to reconnect_min once a connection has
lived 10 seconds.
subscribe_ack_timeout: DurationHow long a subscribe_* call waits for the broker to confirm the subscription (default 3 s). The call
returns when the broker has confirmed: what happens after that is delivered. A refusal is returned as
Rejected. If nothing comes in time, the call fails with Transport and the subscription is taken back, so
the call can be repeated.
Implementations§
§impl MarketDataConfig
impl MarketDataConfig
Trait Implementations§
§impl Clone for MarketDataConfig
impl Clone for MarketDataConfig
§fn clone(&self) -> MarketDataConfig
fn clone(&self) -> MarketDataConfig
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 moreAuto Trait Implementations§
impl Freeze for MarketDataConfig
impl RefUnwindSafe for MarketDataConfig
impl Send for MarketDataConfig
impl Sync for MarketDataConfig
impl Unpin for MarketDataConfig
impl UnsafeUnpin for MarketDataConfig
impl UnwindSafe for MarketDataConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].