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§
Sourcefn date(&self) -> NaiveDate
fn date(&self) -> NaiveDate
The date/time (in the account history) that the action was performed.
Sourcefn 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.