pub trait CryptoProvider: ProviderCore {
// Required method
fn fetch_crypto_quote<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
vs_currency: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<CryptoQuote>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
// Provided methods
fn fetch_protocol_tvl<'life0, 'life1, 'async_trait>(
&'life0 self,
_protocol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ProtocolTvl>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn fetch_protocol_tvl_history<'life0, 'life1, 'async_trait>(
&'life0 self,
_protocol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<TvlPoint>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn fetch_crypto_trending<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrendingCoin>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn fetch_crypto_global<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<GlobalCryptoStats>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn fetch_crypto_news<'life0, 'async_trait>(
&'life0 self,
_limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<News>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
}Expand description
crate::Capability::CRYPTO — cryptocurrency quotes.
Required Methods§
Sourcefn fetch_crypto_quote<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
vs_currency: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<CryptoQuote>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_crypto_quote<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
vs_currency: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<CryptoQuote>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetch a quote for one coin, priced in vs_currency.
Provided Methods§
Sourcefn fetch_protocol_tvl<'life0, 'life1, 'async_trait>(
&'life0 self,
_protocol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ProtocolTvl>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_protocol_tvl<'life0, 'life1, 'async_trait>(
&'life0 self,
_protocol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ProtocolTvl>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch total value locked in a DeFi protocol.
Sourcefn fetch_protocol_tvl_history<'life0, 'life1, 'async_trait>(
&'life0 self,
_protocol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<TvlPoint>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_protocol_tvl_history<'life0, 'life1, 'async_trait>(
&'life0 self,
_protocol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<TvlPoint>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch a DeFi protocol’s TVL history, oldest first.
Sourcefn fetch_crypto_trending<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrendingCoin>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn fetch_crypto_trending<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrendingCoin>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Fetch coins/nfts/categories trending in the last 24h (CoinGecko only).
Sourcefn fetch_crypto_global<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<GlobalCryptoStats>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn fetch_crypto_global<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<GlobalCryptoStats>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Fetch aggregate global cryptocurrency market statistics (CoinGecko only).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".