pub trait QuoteHandler: AssetHandler {
Show 17 methods
// Required methods
fn insert_ticker<'life0, 'life1, 'async_trait>(
&'life0 self,
ticker: &'life1 Ticker,
) -> Pin<Box<dyn Future<Output = Result<usize, DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_ticker_id<'life0, 'life1, 'async_trait>(
&'life0 self,
ticker: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn insert_if_new_ticker<'life0, 'life1, 'async_trait>(
&'life0 self,
ticker: &'life1 Ticker,
) -> Pin<Box<dyn Future<Output = Result<usize, DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_ticker_by_id<'life0, 'async_trait>(
&'life0 self,
id: usize,
) -> Pin<Box<dyn Future<Output = Result<Ticker, DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_all_ticker<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Ticker>, DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_all_ticker_for_source<'life0, 'life1, 'async_trait>(
&'life0 self,
source: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Ticker>, DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_all_ticker_for_asset<'life0, 'async_trait>(
&'life0 self,
asset_id: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Ticker>, DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_ticker<'life0, 'life1, 'async_trait>(
&'life0 self,
ticker: &'life1 Ticker,
) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_ticker<'life0, 'async_trait>(
&'life0 self,
id: usize,
) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn insert_quote<'life0, 'life1, 'async_trait>(
&'life0 self,
quote: &'life1 Quote,
) -> Pin<Box<dyn Future<Output = Result<usize, DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_last_quote_before<'life0, 'life1, 'async_trait>(
&'life0 self,
asset_name: &'life1 str,
time: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(Quote, Currency), DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_last_quote_before_by_id<'life0, 'async_trait>(
&'life0 self,
asset_id: usize,
time: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(Quote, Currency), DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_all_quotes_for_ticker<'life0, 'async_trait>(
&'life0 self,
ticker_id: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_quote<'life0, 'life1, 'async_trait>(
&'life0 self,
quote: &'life1 Quote,
) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_quote<'life0, 'async_trait>(
&'life0 self,
id: usize,
) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_rounding_digits<'life0, 'async_trait>(
&'life0 self,
currency: Currency,
) -> Pin<Box<dyn Future<Output = i32> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_rounding_digits<'life0, 'async_trait>(
&'life0 self,
currency: Currency,
digits: i32,
) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Handler for globally available market quotes data
Required Methods§
fn insert_ticker<'life0, 'life1, 'async_trait>(
&'life0 self,
ticker: &'life1 Ticker,
) -> Pin<Box<dyn Future<Output = Result<usize, DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_ticker_id<'life0, 'life1, 'async_trait>(
&'life0 self,
ticker: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_if_new_ticker<'life0, 'life1, 'async_trait>(
&'life0 self,
ticker: &'life1 Ticker,
) -> Pin<Box<dyn Future<Output = Result<usize, DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_ticker_by_id<'life0, 'async_trait>(
&'life0 self,
id: usize,
) -> Pin<Box<dyn Future<Output = Result<Ticker, DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_ticker<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Ticker>, DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_ticker_for_source<'life0, 'life1, 'async_trait>(
&'life0 self,
source: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Ticker>, DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn get_all_ticker_for_asset<'life0, 'async_trait>(
&'life0 self,
asset_id: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Ticker>, DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_ticker_for_asset<'life0, 'async_trait>(
&'life0 self,
asset_id: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Ticker>, DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all ticker that belong to a given asset specified by its asset ID
fn update_ticker<'life0, 'life1, 'async_trait>(
&'life0 self,
ticker: &'life1 Ticker,
) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_ticker<'life0, 'async_trait>(
&'life0 self,
id: usize,
) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn insert_quote<'life0, 'life1, 'async_trait>(
&'life0 self,
quote: &'life1 Quote,
) -> Pin<Box<dyn Future<Output = Result<usize, DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_quote<'life0, 'life1, 'async_trait>(
&'life0 self,
quote: &'life1 Quote,
) -> Pin<Box<dyn Future<Output = Result<usize, DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Insert, get, update and delete for market data sources
Sourcefn get_last_quote_before<'life0, 'life1, 'async_trait>(
&'life0 self,
asset_name: &'life1 str,
time: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(Quote, Currency), DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_last_quote_before<'life0, 'life1, 'async_trait>(
&'life0 self,
asset_name: &'life1 str,
time: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(Quote, Currency), DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the last quote in database for a specific asset name on or before the given time
Sourcefn get_last_quote_before_by_id<'life0, 'async_trait>(
&'life0 self,
asset_id: usize,
time: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(Quote, Currency), DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_last_quote_before_by_id<'life0, 'async_trait>(
&'life0 self,
asset_id: usize,
time: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(Quote, Currency), DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the last quote in database for a specific asset id on or before the given time