pub struct Balances(/* private fields */);Expand description
Balances: per owner, account and currency, the sum of the base units of the postings. Positive is a debit balance, negative a credit balance.
Implementations§
Source§impl Balances
impl Balances
Sourcepub fn get(
&self,
owner: &PartyId,
account: &AccountId,
currency: &Currency,
) -> i128
pub fn get( &self, owner: &PartyId, account: &AccountId, currency: &Currency, ) -> i128
The balance of account in the books of owner in currency; zero where nothing was posted.
Sourcepub fn iter(
&self,
) -> impl Iterator<Item = (&PartyId, &AccountId, &Currency, i128)>
pub fn iter( &self, ) -> impl Iterator<Item = (&PartyId, &AccountId, &Currency, i128)>
Every balance: owner, account, currency, base units – in that order.
Sourcepub fn rolled_up(
&self,
parents: &BTreeMap<AccountId, AccountId>,
) -> Result<Balances, BalanceError>
pub fn rolled_up( &self, parents: &BTreeMap<AccountId, AccountId>, ) -> Result<Balances, BalanceError>
The balances with every account’s balance also added to each account it refines, so that an account’s
balance includes all accounts below it. parents maps an account to the account it refines.
Trait Implementations§
impl Eq for Balances
impl StructuralPartialEq for Balances
Auto Trait Implementations§
impl Freeze for Balances
impl RefUnwindSafe for Balances
impl Send for Balances
impl Sync for Balances
impl Unpin for Balances
impl UnsafeUnpin for Balances
impl UnwindSafe for Balances
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