pub trait ExchangeExt: Exchange {
// Provided methods
fn supports_market_data(&self) -> bool { ... }
fn supports_trading(&self) -> bool { ... }
fn supports_account(&self) -> bool { ... }
fn supports_margin(&self) -> bool { ... }
fn supports_funding(&self) -> bool { ... }
}Expand description
Extension trait providing access to modular sub-traits from Exchange.
This trait provides helper methods to access the modular trait interfaces from an Exchange implementation. It enables gradual migration from the monolithic Exchange trait to the modular trait hierarchy.
§Example
use ccxt_core::exchange::{Exchange, ExchangeExt};
async fn use_modular_traits(exchange: &dyn Exchange) {
// Access market data functionality
if let Some(market_data) = exchange.as_market_data() {
let ticker = market_data.fetch_ticker("BTC/USDT").await;
}
}Provided Methods§
Sourcefn supports_market_data(&self) -> bool
fn supports_market_data(&self) -> bool
Check if this exchange implements the MarketData trait.
Returns true if the exchange supports market data operations.
Sourcefn supports_trading(&self) -> bool
fn supports_trading(&self) -> bool
Check if this exchange implements the Trading trait.
Returns true if the exchange supports trading operations.
Sourcefn supports_account(&self) -> bool
fn supports_account(&self) -> bool
Check if this exchange implements the Account trait.
Returns true if the exchange supports account operations.
Sourcefn supports_margin(&self) -> bool
fn supports_margin(&self) -> bool
Check if this exchange implements the Margin trait.
Returns true if the exchange supports margin/futures operations.
Sourcefn supports_funding(&self) -> bool
fn supports_funding(&self) -> bool
Check if this exchange implements the Funding trait.
Returns true if the exchange supports funding operations.
Implementors§
impl<T> ExchangeExt for T
Blanket implementation of ExchangeExt for all Exchange implementations.