[][src]Struct doublecount::AccountState

pub struct AccountState {
    pub account: Rc<Account>,
    pub amount: Commodity,
    pub status: AccountStatus,
}

Mutable state associated with an Account.

Fields

account: Rc<Account>

The Account associated with this state

amount: Commodity

The amount of the commodity currently stored in this account

status: AccountStatus

The status of this account (open/closed/etc...)

Methods

impl AccountState[src]

pub fn new(
    account: Rc<Account>,
    amount: Commodity,
    status: AccountStatus
) -> AccountState
[src]

Create a new AccountState.

pub fn open(&mut self)[src]

Open this account, set the status to Open

pub fn close(&mut self)[src]

pub fn eq_approx(&self, other: &AccountState, epsilon: Decimal) -> bool[src]

Trait Implementations

impl Clone for AccountState[src]

impl Debug for AccountState[src]

impl PartialEq<AccountState> for AccountState[src]

impl StructuralPartialEq for AccountState[src]

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.