Trait barter::portfolio::repository::BalanceHandler
source · pub trait BalanceHandler {
// Required methods
fn set_balance(
&mut self,
engine_id: Uuid,
balance: Balance
) -> Result<(), RepositoryError>;
fn get_balance(
&mut self,
engine_id: Uuid
) -> Result<Balance, RepositoryError>;
}
Expand description
Handles the reading & writing of a Portfolio’s current balance to/from the persistence layer.
Required Methods§
sourcefn set_balance(
&mut self,
engine_id: Uuid,
balance: Balance
) -> Result<(), RepositoryError>
fn set_balance( &mut self, engine_id: Uuid, balance: Balance ) -> Result<(), RepositoryError>
Upsert the Portfolio Balance
at the engine_id.
sourcefn get_balance(&mut self, engine_id: Uuid) -> Result<Balance, RepositoryError>
fn get_balance(&mut self, engine_id: Uuid) -> Result<Balance, RepositoryError>
Get the Portfolio Balance
using the engine_id provided.