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§
source§impl PartialEq<Config> for Config
impl PartialEq<Config> for Config
impl Eq for Config
impl StructuralEq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.