pub struct BinanceConfig {
pub order_lookup_timeout_ms: u64,
pub order_lookup_total_timeout_ms: u64,
pub major_symbols: SmallVec<[SmartString; 8]>,
}Expand description
Binance exchange adapter using composition of REST and WebSocket clients
§Usage Patterns
§High-Performance Separate Clients
use BinanceExchange;
// WebSocket-only for market data (optimal memory usage)
let ws_client = BinanceExchange::create_websocket_client(api_key, secret);
// REST-only for order management (optimal for batch operations)
let rest_client = BinanceExchange::create_rest_client(api_key, secret);§Convenient Combined Interface
use BinanceExchange;
// Full exchange adapter (includes both REST + WebSocket)
let exchange = BinanceExchange::new(api_key, secret);
exchange.place_order(order, tx).await?;
// Access underlying clients for performance-critical operations
let rest = exchange.rest_client();
let ws = exchange.websocket_client();§Performance Recommendations
- Market Data Feeds: Use
BinanceWebSocketClientdirectly - Order Management: Use
BinanceRestClientdirectly - Full Applications: Use
BinanceExchangefacade - Microservices: Use separate clients per service
§Configuration for Binance exchange operations
Fields§
§order_lookup_timeout_ms: u64Timeout for individual order lookup requests (milliseconds)
order_lookup_total_timeout_ms: u64Total timeout for concurrent order lookups (milliseconds)
major_symbols: SmallVec<[SmartString; 8]>Major symbols for order lookup fallback
Implementations§
Source§impl BinanceConfig
impl BinanceConfig
Sourcepub fn high_frequency() -> Self
pub fn high_frequency() -> Self
Create config optimized for high-frequency trading
Trait Implementations§
Source§impl Clone for BinanceConfig
impl Clone for BinanceConfig
Source§fn clone(&self) -> BinanceConfig
fn clone(&self) -> BinanceConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BinanceConfig
impl Debug for BinanceConfig
Auto Trait Implementations§
impl Freeze for BinanceConfig
impl RefUnwindSafe for BinanceConfig
impl Send for BinanceConfig
impl Sync for BinanceConfig
impl Unpin for BinanceConfig
impl UnwindSafe for BinanceConfig
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