pub struct ExchangeCapabilities { /* private fields */ }Expand description
Exchange capabilities configuration
This struct provides a high-level API for working with exchange capabilities, maintaining backward compatibility with the original boolean-field design while using efficient bitflags internally.
§Example
use ccxt_core::capability::ExchangeCapabilities;
let caps = ExchangeCapabilities::public_only();
assert!(caps.has("fetchTicker"));
assert!(!caps.has("createOrder"));
let caps = ExchangeCapabilities::all();
assert!(caps.fetch_ticker());
assert!(caps.create_order());Implementations§
Source§impl ExchangeCapabilities
impl ExchangeCapabilities
Sourcepub const fn public_only() -> Self
pub const fn public_only() -> Self
Create capabilities for public API only (no authentication required)
Sourcepub const fn from_capabilities(caps: Capabilities) -> Self
pub const fn from_capabilities(caps: Capabilities) -> Self
Create from raw Capabilities bitflags
Sourcepub const fn as_capabilities(&self) -> Capabilities
pub const fn as_capabilities(&self) -> Capabilities
Get the underlying Capabilities bitflags
Sourcepub fn supported_capabilities(&self) -> Vec<&'static str>
pub fn supported_capabilities(&self) -> Vec<&'static str>
Get a list of all supported capability names
pub const fn fetch_markets(&self) -> bool
pub const fn fetch_currencies(&self) -> bool
pub const fn fetch_ticker(&self) -> bool
pub const fn fetch_tickers(&self) -> bool
pub const fn fetch_order_book(&self) -> bool
pub const fn fetch_trades(&self) -> bool
pub const fn fetch_ohlcv(&self) -> bool
pub const fn fetch_status(&self) -> bool
pub const fn fetch_time(&self) -> bool
pub const fn create_order(&self) -> bool
pub const fn create_market_order(&self) -> bool
pub const fn create_limit_order(&self) -> bool
pub const fn cancel_order(&self) -> bool
pub const fn cancel_all_orders(&self) -> bool
pub const fn edit_order(&self) -> bool
pub const fn fetch_order(&self) -> bool
pub const fn fetch_orders(&self) -> bool
pub const fn fetch_open_orders(&self) -> bool
pub const fn fetch_closed_orders(&self) -> bool
pub const fn fetch_canceled_orders(&self) -> bool
pub const fn fetch_balance(&self) -> bool
pub const fn fetch_my_trades(&self) -> bool
pub const fn fetch_deposits(&self) -> bool
pub const fn fetch_withdrawals(&self) -> bool
pub const fn fetch_transactions(&self) -> bool
pub const fn fetch_ledger(&self) -> bool
pub const fn fetch_deposit_address(&self) -> bool
pub const fn create_deposit_address(&self) -> bool
pub const fn withdraw(&self) -> bool
pub const fn transfer(&self) -> bool
pub const fn fetch_borrow_rate(&self) -> bool
pub const fn fetch_borrow_rates(&self) -> bool
pub const fn fetch_funding_rate(&self) -> bool
pub const fn fetch_funding_rates(&self) -> bool
pub const fn fetch_positions(&self) -> bool
pub const fn set_leverage(&self) -> bool
pub const fn set_margin_mode(&self) -> bool
pub const fn websocket(&self) -> bool
pub const fn watch_ticker(&self) -> bool
pub const fn watch_tickers(&self) -> bool
pub const fn watch_order_book(&self) -> bool
pub const fn watch_trades(&self) -> bool
pub const fn watch_ohlcv(&self) -> bool
pub const fn watch_balance(&self) -> bool
pub const fn watch_orders(&self) -> bool
pub const fn watch_my_trades(&self) -> bool
Sourcepub fn builder() -> ExchangeCapabilitiesBuilder
pub fn builder() -> ExchangeCapabilitiesBuilder
Create a builder for ExchangeCapabilities
Sourcepub const fn spot_exchange() -> Self
pub const fn spot_exchange() -> Self
Create capabilities for a typical spot exchange
Sourcepub const fn futures_exchange() -> Self
pub const fn futures_exchange() -> Self
Create capabilities for a typical futures exchange
Sourcepub const fn full_featured() -> Self
pub const fn full_featured() -> Self
Create capabilities for a full-featured exchange (like Binance)
pub const fn supports_market_data(&self) -> bool
pub const fn supports_trading(&self) -> bool
pub const fn supports_account(&self) -> bool
pub const fn supports_margin(&self) -> bool
pub const fn supports_funding(&self) -> bool
pub const fn supports_websocket(&self) -> bool
pub const fn supports_full_exchange(&self) -> bool
pub const fn supports_trait(&self, category: TraitCategory) -> bool
pub fn supported_traits(&self) -> Vec<TraitCategory>
pub const fn capabilities_for_trait( &self, category: TraitCategory, ) -> Capabilities
pub const fn trait_for_capability(capability: Capability) -> TraitCategory
Trait Implementations§
Source§impl Clone for ExchangeCapabilities
impl Clone for ExchangeCapabilities
Source§fn clone(&self) -> ExchangeCapabilities
fn clone(&self) -> ExchangeCapabilities
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 ExchangeCapabilities
impl Debug for ExchangeCapabilities
Source§impl Default for ExchangeCapabilities
impl Default for ExchangeCapabilities
Source§fn default() -> ExchangeCapabilities
fn default() -> ExchangeCapabilities
Returns the “default value” for a type. Read more
Source§impl Display for ExchangeCapabilities
impl Display for ExchangeCapabilities
Source§impl From<Capabilities> for ExchangeCapabilities
impl From<Capabilities> for ExchangeCapabilities
Source§fn from(caps: Capabilities) -> Self
fn from(caps: Capabilities) -> Self
Converts to this type from the input type.
Source§impl Hash for ExchangeCapabilities
impl Hash for ExchangeCapabilities
Source§impl PartialEq for ExchangeCapabilities
impl PartialEq for ExchangeCapabilities
impl Copy for ExchangeCapabilities
impl Eq for ExchangeCapabilities
impl StructuralPartialEq for ExchangeCapabilities
Auto Trait Implementations§
impl Freeze for ExchangeCapabilities
impl RefUnwindSafe for ExchangeCapabilities
impl Send for ExchangeCapabilities
impl Sync for ExchangeCapabilities
impl Unpin for ExchangeCapabilities
impl UnwindSafe for ExchangeCapabilities
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.