I am a novice of rust and try to read some projects for studying. In this binance api connector rust project. Some dependencies are set to be optional but others not. What is the considerations that some dependencies should be set to optional while others not?
[features]
default = ["enable-ureq", "enable-tungstenite"]
enable-hyper = [ "hyper", "hyper-tls", "serde_json", "futures-util", "tokio" ]
enable-ureq = [ "ureq", "serde_json" ]
enable-tungstenite = ["tungstenite"]
enable-tokio-tungstenite = ["tokio-tungstenite"]
full = ["enable-hyper", "enable-tungstenite", "enable-ureq", "enable-tokio-tungstenite"]
[dependencies]
hmac = "0.12.0"
log = "0.4.14"
serde = { version = "1.0.136", features = ["derive"] }
sha2 = { version = "0.10.6", default-features = false, features = ["oid"] }
url = "2.2.2"
rust_decimal = "1.24.0"
http = "0.2.7"
strum = { version = "0.24", features = ["derive"] }
rand = "0.8.5"
signature = "2.2.0"
base64 = "0.13.1"
ed25519-dalek = { version = "2.1.0", features = ["serde", "zeroize", "rand_core", "digest", "pkcs8", "pem"] }
# enable-ureq
ureq = { version = "2.4.0", optional = true }
# enable-hyper
hyper = { version = "0.14.16", features = ["full"], optional = true }
serde_json = { version = "1.0.78", optional = true }
hyper-tls = {version = "0.5.0", optional = true }
futures-util = {version = "0.3.21", optional = true }
tokio = { version = "1", features = ["time"], optional = true }
# enable-tungstenite
tungstenite = {version = "0.20.1", features = ["native-tls"], optional = true}
# enable-tokio-tungstenite
tokio-tungstenite = {version = "0.17.1", features = ["native-tls"], optional = true}
Explanation about the standard to make a dependency optional in rust cargo.toml