Trait Action

Source
pub trait Action<AT, ATV>: Display + Debug {
    // Required methods
    fn date(&self) -> NaiveDate;
    fn perform(
        &self,
        program_state: &mut ProgramState<AT, ATV>,
    ) -> Result<(), AccountingError>;
}
Expand description

Represents an action which can modify ProgramState.

Required Methods§

Source

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>

Perform the action to mutate the ProgramState.

Implementors§

Source§

impl<AT, ATV> Action<AT, ATV> for BalanceAssertion
where ATV: ActionTypeValueEnum<AT>,

Source§

impl<AT, ATV> Action<AT, ATV> for EditAccountStatus
where ATV: ActionTypeValueEnum<AT>,

Source§

impl<AT, ATV> Action<AT, ATV> for Transaction
where ATV: ActionTypeValueEnum<AT>,