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§

source

fn set_balance( &mut self, engine_id: Uuid, balance: Balance ) -> Result<(), RepositoryError>

Upsert the Portfolio Balance at the engine_id.

source

fn get_balance(&mut self, engine_id: Uuid) -> Result<Balance, RepositoryError>

Get the Portfolio Balance using the engine_id provided.

Implementors§