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 password(self, password: impl Into<String>) -> Self
pub fn password(self, password: impl Into<String>) -> Self
Set the password (required by some exchanges)
Sourcepub fn account_id(self, account_id: impl Into<String>) -> Self
pub fn account_id(self, account_id: impl Into<String>) -> Self
Set the account ID
Sourcepub fn enable_rate_limit(self, enabled: bool) -> Self
pub fn enable_rate_limit(self, enabled: bool) -> Self
Enable or disable rate limiting
Sourcepub fn rate_limit(self, rate_limit: f64) -> Self
pub fn rate_limit(self, rate_limit: f64) -> Self
Set the rate limit in milliseconds between requests
Sourcepub fn user_agent(self, user_agent: impl Into<String>) -> Self
pub fn user_agent(self, user_agent: impl Into<String>) -> Self
Set a custom user agent string
Sourcepub fn url_override(
self,
key: impl Into<String>,
url: impl Into<String>,
) -> Self
pub fn url_override( self, key: impl Into<String>, url: impl Into<String>, ) -> Self
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