Trait barter::portfolio::repository::StatisticHandler
source · [−]pub trait StatisticHandler<Statistic> {
fn set_statistics(
&mut self,
market_id: &MarketId,
statistic: Statistic
) -> Result<(), RepositoryError>;
fn get_statistics(
&mut self,
market_id: &MarketId
) -> Result<Statistic, RepositoryError>;
}
Expand description
Handles the reading & writing of a Portfolio’s statistics for each of it’s
markets, where each market is represented by a MarketId
.
Required methods
fn set_statistics(
&mut self,
market_id: &MarketId,
statistic: Statistic
) -> Result<(), RepositoryError>
fn set_statistics(
&mut self,
market_id: &MarketId,
statistic: Statistic
) -> Result<(), RepositoryError>
Upsert the market statistics at the MarketId
provided.
fn get_statistics(
&mut self,
market_id: &MarketId
) -> Result<Statistic, RepositoryError>
fn get_statistics(
&mut self,
market_id: &MarketId
) -> Result<Statistic, RepositoryError>
Get the market statistics using the MarketId
provided.