pub struct WorldBankClient { /* private fields */ }Expand description
Client for World Bank Open Data API
Provides access to global development indicators including:
- GDP per capita, population, poverty rates
- Health expenditure, life expectancy
- CO2 emissions, renewable energy
- Education, infrastructure metrics
§Example
ⓘ
use ruvector_data_framework::WorldBankClient;
let client = WorldBankClient::new()?;
let gdp_global = client.get_gdp_global().await?;
let climate = client.get_climate_indicators().await?;
let health = client.get_indicator("USA", "SH.XPD.CHEX.GD.ZS").await?;Implementations§
Source§impl WorldBankClient
impl WorldBankClient
Sourcepub async fn get_indicator(
&self,
country: &str,
indicator: &str,
) -> Result<Vec<SemanticVector>>
pub async fn get_indicator( &self, country: &str, indicator: &str, ) -> Result<Vec<SemanticVector>>
Get indicator data for a specific country
§Arguments
country- ISO 3-letter country code (e.g., “USA”, “CHN”, “GBR”) or “all”indicator- World Bank indicator code (e.g., “NY.GDP.PCAP.CD” for GDP per capita)
§Example
ⓘ
// Get US GDP per capita
let us_gdp = client.get_indicator("USA", "NY.GDP.PCAP.CD").await?;Sourcepub async fn get_gdp_global(&self) -> Result<Vec<SemanticVector>>
pub async fn get_gdp_global(&self) -> Result<Vec<SemanticVector>>
Sourcepub async fn get_climate_indicators(&self) -> Result<Vec<SemanticVector>>
pub async fn get_climate_indicators(&self) -> Result<Vec<SemanticVector>>
Sourcepub async fn get_health_indicators(&self) -> Result<Vec<SemanticVector>>
pub async fn get_health_indicators(&self) -> Result<Vec<SemanticVector>>
Sourcepub async fn get_population(&self) -> Result<Vec<SemanticVector>>
pub async fn get_population(&self) -> Result<Vec<SemanticVector>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorldBankClient
impl !RefUnwindSafe for WorldBankClient
impl Send for WorldBankClient
impl Sync for WorldBankClient
impl Unpin for WorldBankClient
impl !UnwindSafe for WorldBankClient
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