[][src]Struct doublecount::ProgramState

pub struct ProgramState {
    pub account_states: HashMap<AccountID, AccountState>,
    pub failed_balance_assertions: Vec<FailedBalanceAssertion>,
    // some fields omitted
}

The state of a Program being executed.

Fields

account_states: HashMap<AccountID, AccountState>

list of states associated with accounts (can only grow)

failed_balance_assertions: Vec<FailedBalanceAssertion>

list of failed assertions, and associated failed balance

Methods

impl ProgramState[src]

pub fn new(
    accounts: &Vec<Rc<Account>>,
    account_status: AccountStatus
) -> ProgramState
[src]

Create a new ProgramState.

pub fn execute_program(
    &mut self,
    program: &Program
) -> Result<(), AccountingError>
[src]

Execute a given Program to mutate this state.

pub fn get_account_state(&self, account_id: &AccountID) -> Option<&AccountState>[src]

Get a reference to the AccountState associated with a given Account.

pub fn get_account_state_mut(
    &mut self,
    account_id: &AccountID
) -> Option<&mut AccountState>
[src]

Get a mutable reference to the AccountState associated with the given Account.

pub fn record_failed_balance_assertion(
    &mut self,
    failed_balance_assertion: FailedBalanceAssertion
)
[src]

Record a failed BalanceAssertion using a FailedBalanceAssertion.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.