pub struct Config {
pub rest_api_endpoint: String,
pub ws_endpoint: String,
pub futures_rest_api_endpoint: String,
pub futures_ws_endpoint: String,
pub recv_window: u64,
pub binance_us_api: bool,
pub timeout: Option<u64>,
}Fields§
§rest_api_endpoint: String§ws_endpoint: String§futures_rest_api_endpoint: String§futures_ws_endpoint: String§recv_window: u64§binance_us_api: bool§timeout: Option<u64>Implementations§
Source§impl Config
impl Config
Sourcepub fn testnet() -> Config
pub fn testnet() -> Config
Configure binance with all testnet endpoints
§Examples
use binance::config::Config;
let config = Config::testnet();Sourcepub fn set_rest_api_endpoint<T: Into<String>>(
self,
rest_api_endpoint: T,
) -> Self
pub fn set_rest_api_endpoint<T: Into<String>>( self, rest_api_endpoint: T, ) -> Self
Sets the rest api endpoint. Defaults to https://api.binance.com.
§Arguments
rest_api_endpoint:
returns: Config
§Examples
use binance::config::Config;
let config = Config::default();
config.set_rest_api_endpoint("http://myendpoint:8080");Sourcepub fn set_ws_endpoint<T: Into<String>>(self, ws_endpoint: T) -> Self
pub fn set_ws_endpoint<T: Into<String>>(self, ws_endpoint: T) -> Self
Sourcepub fn set_futures_rest_api_endpoint<T: Into<String>>(
self,
futures_rest_api_endpoint: T,
) -> Self
pub fn set_futures_rest_api_endpoint<T: Into<String>>( self, futures_rest_api_endpoint: T, ) -> Self
Sets the futures rest api endpoint. Defaults to https://fapi.binance.com.
§Arguments
futures_rest_api_endpoint:
returns: Config
§Examples
use binance::config::Config;
let config = Config::default();
config.set_futures_rest_api_endpoint("http://myendpoint:8080");Sourcepub fn set_futures_ws_endpoint<T: Into<String>>(
self,
futures_ws_endpoint: T,
) -> Self
pub fn set_futures_ws_endpoint<T: Into<String>>( self, futures_ws_endpoint: T, ) -> Self
Sourcepub fn set_recv_window(self, recv_window: u64) -> Self
pub fn set_recv_window(self, recv_window: u64) -> Self
Sets the ‘receive window’. The receive window is the number of milliseconds after timestamp the request is valid for.
§Arguments
recv_window: The receive window, in milliseconds. Defaults to 5000.
returns: Config
§Examples
use binance::config::Config;
let config = Config::default();
config.set_recv_window(300);Sourcepub fn set_timeout(self, timeout: u64) -> Self
pub fn set_timeout(self, timeout: u64) -> Self
Trait Implementations§
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.