pub struct BalanceAssertion { /* private fields */ }
Expand description
A type of Action to check and assert the balance of a given Account in its AccountStatus at the beginning of the given date.
When running its perform() method, if this assertion fails, a FailedBalanceAssertion will be recorded in the ProgramState.
Implementations§
Source§impl BalanceAssertion
impl BalanceAssertion
Sourcepub fn new(
account_id: AccountID,
date: NaiveDate,
expected_balance: Commodity,
) -> BalanceAssertion
pub fn new( account_id: AccountID, date: NaiveDate, expected_balance: Commodity, ) -> BalanceAssertion
Create a new BalanceAssertion. The balance
will be considered at the beginning of the provided date
.
Trait Implementations§
Source§impl<AT, ATV> Action<AT, ATV> for BalanceAssertionwhere
ATV: ActionTypeValueEnum<AT>,
impl<AT, ATV> Action<AT, ATV> for BalanceAssertionwhere
ATV: ActionTypeValueEnum<AT>,
Source§fn date(&self) -> NaiveDate
fn date(&self) -> NaiveDate
The date/time (in the account history) that the action was performed.
Source§fn perform(
&self,
program_state: &mut ProgramState<AT, ATV>,
) -> Result<(), AccountingError>
fn perform( &self, program_state: &mut ProgramState<AT, ATV>, ) -> Result<(), AccountingError>
Perform the action to mutate the ProgramState.
Source§impl ActionTypeFor<ActionType> for BalanceAssertion
impl ActionTypeFor<ActionType> for BalanceAssertion
Source§fn action_type(&self) -> ActionType
fn action_type(&self) -> ActionType
What type of action is being performed.
Source§impl Clone for BalanceAssertion
impl Clone for BalanceAssertion
Source§fn clone(&self) -> BalanceAssertion
fn clone(&self) -> BalanceAssertion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BalanceAssertion
impl Debug for BalanceAssertion
Source§impl<'de> Deserialize<'de> for BalanceAssertion
impl<'de> Deserialize<'de> for BalanceAssertion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for BalanceAssertion
impl Display for BalanceAssertion
Source§impl From<BalanceAssertion> for ActionTypeValue
impl From<BalanceAssertion> for ActionTypeValue
Source§fn from(action: BalanceAssertion) -> Self
fn from(action: BalanceAssertion) -> Self
Converts to this type from the input type.
Source§impl PartialEq for BalanceAssertion
impl PartialEq for BalanceAssertion
Source§impl Serialize for BalanceAssertion
impl Serialize for BalanceAssertion
impl StructuralPartialEq for BalanceAssertion
Auto Trait Implementations§
impl Freeze for BalanceAssertion
impl RefUnwindSafe for BalanceAssertion
impl Send for BalanceAssertion
impl Sync for BalanceAssertion
impl Unpin for BalanceAssertion
impl UnwindSafe for BalanceAssertion
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