pub struct ExchangeOptions {
pub market_type: MarketType,
pub testnet: bool,
pub recv_window_ms: u64,
pub timeout: Duration,
pub user_agent: Option<String>,
pub proxy: Option<String>,
pub position_mode: PositionMode,
pub margin_mode: MarginMode,
}Expand description
Configuration for one exchange connection.
Fields§
§market_type: MarketTypeWhich market of the venue to use.
testnet: boolUse the venue’s testnet/sandbox rather than mainnet.
recv_window_ms: u64The signed-request receive window in milliseconds (how long a signed request stays valid against the server clock).
timeout: DurationPer-request timeout.
user_agent: Option<String>Optional User-Agent header override.
proxy: Option<String>Optional HTTP/HTTPS proxy URL.
position_mode: PositionModeDerivatives position mode.
margin_mode: MarginModeDerivatives margin mode.
Implementations§
Source§impl ExchangeOptions
impl ExchangeOptions
Sourcepub fn mainnet(market_type: MarketType) -> ExchangeOptions
pub fn mainnet(market_type: MarketType) -> ExchangeOptions
Mainnet options for the given market, with sensible defaults.
Sourcepub fn testnet(market_type: MarketType) -> ExchangeOptions
pub fn testnet(market_type: MarketType) -> ExchangeOptions
Testnet/sandbox options for the given market.
Sourcepub fn with_recv_window(self, ms: u64) -> ExchangeOptions
pub fn with_recv_window(self, ms: u64) -> ExchangeOptions
Override the receive window (milliseconds).
Sourcepub fn with_timeout(self, timeout: Duration) -> ExchangeOptions
pub fn with_timeout(self, timeout: Duration) -> ExchangeOptions
Override the per-request timeout.
Sourcepub fn with_position_mode(self, mode: PositionMode) -> ExchangeOptions
pub fn with_position_mode(self, mode: PositionMode) -> ExchangeOptions
Override the position mode (derivatives).
Sourcepub fn with_margin_mode(self, mode: MarginMode) -> ExchangeOptions
pub fn with_margin_mode(self, mode: MarginMode) -> ExchangeOptions
Override the margin mode (derivatives).
Trait Implementations§
Source§impl Clone for ExchangeOptions
impl Clone for ExchangeOptions
Source§fn clone(&self) -> ExchangeOptions
fn clone(&self) -> ExchangeOptions
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 moreSource§impl Debug for ExchangeOptions
impl Debug for ExchangeOptions
Source§impl Default for ExchangeOptions
impl Default for ExchangeOptions
Source§fn default() -> ExchangeOptions
fn default() -> ExchangeOptions
Mainnet spot with default transport knobs.
Auto Trait Implementations§
impl Freeze for ExchangeOptions
impl RefUnwindSafe for ExchangeOptions
impl Send for ExchangeOptions
impl Sync for ExchangeOptions
impl Unpin for ExchangeOptions
impl UnsafeUnpin for ExchangeOptions
impl UnwindSafe for ExchangeOptions
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more