pub struct ExchangeConfigBuilder { /* private fields */ }Expand description
Builder for ExchangeConfig
Provides a fluent API for constructing exchange configurations.
§Example
use ccxt_core::base_exchange::ExchangeConfigBuilder;
let config = ExchangeConfigBuilder::new()
.id("binance")
.name("Binance")
.api_key("your-api-key")
.secret("your-secret")
.timeout(60)
.build();Implementations§
Source§impl ExchangeConfigBuilder
impl ExchangeConfigBuilder
Sourcepub fn new() -> ExchangeConfigBuilder
pub fn new() -> ExchangeConfigBuilder
Create a new builder with default configuration
Sourcepub fn id(self, id: impl Into<String>) -> ExchangeConfigBuilder
pub fn id(self, id: impl Into<String>) -> ExchangeConfigBuilder
Set the exchange identifier
Sourcepub fn name(self, name: impl Into<String>) -> ExchangeConfigBuilder
pub fn name(self, name: impl Into<String>) -> ExchangeConfigBuilder
Set the exchange display name
Sourcepub fn api_key(self, key: impl Into<String>) -> ExchangeConfigBuilder
pub fn api_key(self, key: impl Into<String>) -> ExchangeConfigBuilder
Set the API key for authentication
Sourcepub fn secret(self, secret: impl Into<String>) -> ExchangeConfigBuilder
pub fn secret(self, secret: impl Into<String>) -> ExchangeConfigBuilder
Set the API secret for authentication
Sourcepub fn password(self, password: impl Into<String>) -> ExchangeConfigBuilder
pub fn password(self, password: impl Into<String>) -> ExchangeConfigBuilder
Set the password (required by some exchanges)
Sourcepub fn uid(self, uid: impl Into<String>) -> ExchangeConfigBuilder
pub fn uid(self, uid: impl Into<String>) -> ExchangeConfigBuilder
Set the user ID (required by some exchanges)
Sourcepub fn account_id(self, account_id: impl Into<String>) -> ExchangeConfigBuilder
pub fn account_id(self, account_id: impl Into<String>) -> ExchangeConfigBuilder
Set the account ID
Sourcepub fn enable_rate_limit(self, enabled: bool) -> ExchangeConfigBuilder
pub fn enable_rate_limit(self, enabled: bool) -> ExchangeConfigBuilder
Enable or disable rate limiting
Sourcepub fn rate_limit(self, rate_limit: u32) -> ExchangeConfigBuilder
pub fn rate_limit(self, rate_limit: u32) -> ExchangeConfigBuilder
Set the rate limit in requests per second
Sourcepub fn timeout(self, seconds: u64) -> ExchangeConfigBuilder
pub fn timeout(self, seconds: u64) -> ExchangeConfigBuilder
Set the request timeout in seconds
Sourcepub fn sandbox(self, enabled: bool) -> ExchangeConfigBuilder
pub fn sandbox(self, enabled: bool) -> ExchangeConfigBuilder
Enable or disable sandbox/testnet mode
Sourcepub fn user_agent(self, user_agent: impl Into<String>) -> ExchangeConfigBuilder
pub fn user_agent(self, user_agent: impl Into<String>) -> ExchangeConfigBuilder
Set a custom user agent string
Sourcepub fn proxy(self, proxy: impl Into<String>) -> ExchangeConfigBuilder
pub fn proxy(self, proxy: impl Into<String>) -> ExchangeConfigBuilder
Set the HTTP proxy server URL
Sourcepub fn verbose(self, enabled: bool) -> ExchangeConfigBuilder
pub fn verbose(self, enabled: bool) -> ExchangeConfigBuilder
Enable or disable verbose logging
Sourcepub fn option(
self,
key: impl Into<String>,
value: Value,
) -> ExchangeConfigBuilder
pub fn option( self, key: impl Into<String>, value: Value, ) -> ExchangeConfigBuilder
Set a custom option
Sourcepub fn options(self, options: HashMap<String, Value>) -> ExchangeConfigBuilder
pub fn options(self, options: HashMap<String, Value>) -> ExchangeConfigBuilder
Set multiple custom options
Sourcepub fn url_override(
self,
key: impl Into<String>,
url: impl Into<String>,
) -> ExchangeConfigBuilder
pub fn url_override( self, key: impl Into<String>, url: impl Into<String>, ) -> ExchangeConfigBuilder
Set a URL override for a specific key (e.g., “public”, “private”)
Sourcepub fn build(self) -> ExchangeConfig
pub fn build(self) -> ExchangeConfig
Build the configuration
Trait Implementations§
Source§impl Clone for ExchangeConfigBuilder
impl Clone for ExchangeConfigBuilder
Source§fn clone(&self) -> ExchangeConfigBuilder
fn clone(&self) -> ExchangeConfigBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExchangeConfigBuilder
impl Debug for ExchangeConfigBuilder
Source§impl Default for ExchangeConfigBuilder
impl Default for ExchangeConfigBuilder
Source§fn default() -> ExchangeConfigBuilder
fn default() -> ExchangeConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ExchangeConfigBuilder
impl RefUnwindSafe for ExchangeConfigBuilder
impl Send for ExchangeConfigBuilder
impl Sync for ExchangeConfigBuilder
impl Unpin for ExchangeConfigBuilder
impl UnwindSafe for ExchangeConfigBuilder
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