pub struct CoinGeckoClient { /* private fields */ }Expand description
Client for CoinGecko Cryptocurrency API
Provides cryptocurrency prices, market data, and historical charts. No authentication required for basic usage (50 calls/minute).
§Example
ⓘ
use ruvector_data_framework::CoinGeckoClient;
let client = CoinGeckoClient::new()?;
let prices = client.get_price(&["bitcoin", "ethereum"], &["usd", "eur"]).await?;
let coin = client.get_coin("bitcoin").await?;Implementations§
Source§impl CoinGeckoClient
impl CoinGeckoClient
Sourcepub async fn get_price(
&self,
ids: &[&str],
vs_currencies: &[&str],
) -> Result<Vec<SemanticVector>>
pub async fn get_price( &self, ids: &[&str], vs_currencies: &[&str], ) -> Result<Vec<SemanticVector>>
Get simple price for cryptocurrencies
§Arguments
ids- Coin IDs (e.g., [“bitcoin”, “ethereum”])vs_currencies- Target currencies (e.g., [“usd”, “eur”])
Sourcepub async fn get_market_chart(
&self,
id: &str,
days: &str,
) -> Result<Vec<SemanticVector>>
pub async fn get_market_chart( &self, id: &str, days: &str, ) -> Result<Vec<SemanticVector>>
Get historical market chart data
§Arguments
id- Coin IDdays- Number of days (1, 7, 14, 30, 90, 180, 365, max)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CoinGeckoClient
impl !RefUnwindSafe for CoinGeckoClient
impl Send for CoinGeckoClient
impl Sync for CoinGeckoClient
impl Unpin for CoinGeckoClient
impl !UnwindSafe for CoinGeckoClient
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more