finance_query/domains/indices.rs
1//! Stock market index quote handle.
2//!
3//! Created via [`Providers::index`](crate::Providers::index).
4
5use crate::error::Result;
6
7domain_handle! {
8 /// A stock market index backed by configured data providers.
9 ///
10 /// Created via [`Providers::index`](crate::Providers::index).
11 pub struct Index { symbol, symbol }
12}
13
14impl Index {
15 /// Fetch the current quote for this index.
16 pub async fn quote(&self) -> Result<crate::models::indices::IndexQuote> {
17 fetch_via!(
18 self,
19 symbol,
20 INDICES,
21 fetch_indices_quote,
22 crate::models::indices::IndexQuote
23 )
24 }
25}