pub struct Balance<'ctx> { /* private fields */ }Expand description
Accumulated balance of accounts.
Implementations§
Source§impl<'ctx> Balance<'ctx>
impl<'ctx> Balance<'ctx>
Sourcepub fn add_amount(
&mut self,
account: Account<'ctx>,
amount: Amount<'ctx>,
) -> &Amount<'ctx>
pub fn add_amount( &mut self, account: Account<'ctx>, amount: Amount<'ctx>, ) -> &Amount<'ctx>
Adds a particular account value, and returns the updated balance.
Sourcepub fn add_posting_amount(
&mut self,
account: Account<'ctx>,
amount: PostingAmount<'ctx>,
) -> &Amount<'ctx>
pub fn add_posting_amount( &mut self, account: Account<'ctx>, amount: PostingAmount<'ctx>, ) -> &Amount<'ctx>
Adds a particular account value with the specified commodity, and returns the updated balance.
Sourcepub fn set_partial(
&mut self,
account: Account<'ctx>,
amount: PostingAmount<'ctx>,
) -> Result<PostingAmount<'ctx>, BalanceError>
pub fn set_partial( &mut self, account: Account<'ctx>, amount: PostingAmount<'ctx>, ) -> Result<PostingAmount<'ctx>, BalanceError>
Tries to set the particular account’s balance with the specified commodity, and returns the delta which should have caused the difference.
Trait Implementations§
Source§impl<'ctx> FromIterator<(Account<'ctx>, Amount<'ctx>)> for Balance<'ctx>
impl<'ctx> FromIterator<(Account<'ctx>, Amount<'ctx>)> for Balance<'ctx>
impl<'ctx> Eq for Balance<'ctx>
impl<'ctx> StructuralPartialEq for Balance<'ctx>
Auto Trait Implementations§
impl<'ctx> Freeze for Balance<'ctx>
impl<'ctx> RefUnwindSafe for Balance<'ctx>
impl<'ctx> Send for Balance<'ctx>
impl<'ctx> Sync for Balance<'ctx>
impl<'ctx> Unpin for Balance<'ctx>
impl<'ctx> UnwindSafe for Balance<'ctx>
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