1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! Configuration options for initializing a `BinanceWorker`.
//!
//! This module provides the [`WorkerOpts`] used to configure a `BinanceWorker`.
//! It allows setting the WebSocket URL and the maximum number of subscriptions per connection,
//! which are used by [`Worker`](`crate::worker::Worker`) to interact with the Binance WebSocket API.
//!
//! The module provides:
//! - The [`WorkerOpts`] for specifying worker parameters
//! - Serialization and deserialization support for configuration files
//! - Defaults for WebSocket URL and maximum subscriptions per connection
//! - Internal helpers for handling empty or missing configuration values
//!
use ;
use crateDEFAULT_URL;
use crateMAX_SUBSCRIPTION_PER_CONNECTION;
/// Options for configuring the `BinanceWorker`.
///
/// [`WorkerOpts`] provides a way to specify custom values for creating a
/// `BinanceWorker`. It specifies parameters such as the WebSocket URL and the maximum number of
/// subscriptions per connection, which are used to interact with the Binance WebSocket API.
///
/// # Examples
///
/// ```rust
/// use bothan_binance::worker::opts::WorkerOpts;
///
/// let opts = WorkerOpts {
/// url: "wss://stream.binance.com:9443/ws".to_string(),
/// max_subscription_per_connection: 200,
/// };
/// ```
/// This function returns the default WebSocket URL for the Binance API.
/// This function returns the default maximum number of subscriptions per connection.