pub struct Balance {
pub account_balances: HashMap<String, AccountBalance>,
}
Expand description
Balance of one or more accounts.
Maps account names to their balances.
Fields§
§account_balances: HashMap<String, AccountBalance>
Implementations§
Source§impl Balance
impl Balance
pub fn new() -> Balance
pub fn update_with_transaction(&mut self, transaction: &Transaction)
pub fn get_account_balance(&self, account_prefixes: &[&str]) -> AccountBalance
pub fn add_amount(&mut self, account: &str, amount: &Amount)
Trait Implementations§
Source§impl<'a> AddAssign<&'a Balance> for Balance
impl<'a> AddAssign<&'a Balance> for Balance
Source§fn add_assign(&mut self, other: &'a Balance)
fn add_assign(&mut self, other: &'a Balance)
Performs the
+=
operation. Read moreSource§impl<'a> From<&'a Transaction> for Balance
impl<'a> From<&'a Transaction> for Balance
Source§fn from(transaction: &'a Transaction) -> Self
fn from(transaction: &'a Transaction) -> Self
Converts to this type from the input type.
Source§impl From<Balance> for TreeBalanceNode
impl From<Balance> for TreeBalanceNode
Auto Trait Implementations§
impl Freeze for Balance
impl RefUnwindSafe for Balance
impl Send for Balance
impl Sync for Balance
impl Unpin for Balance
impl UnwindSafe for Balance
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more