Struct lumi::parse::LedgerDraft[][src]

pub struct LedgerDraft {
    pub accounts: HashMap<Account, AccountInfoDraft>,
    pub commodities: HashMap<Currency, (Meta, Source)>,
    pub txns: Vec<TxnDraft>,
    pub options: HashMap<String, (String, Source)>,
    pub events: HashMap<String, Vec<EventInfo>>,
}

Contains the information collected by a parser from the source files, which might include unbalanced transactions or other errors.

Fields

accounts: HashMap<Account, AccountInfoDraft>commodities: HashMap<Currency, (Meta, Source)>txns: Vec<TxnDraft>options: HashMap<String, (String, Source)>events: HashMap<String, Vec<EventInfo>>

Implementations

impl LedgerDraft[src]

pub fn into_ledger(self) -> (Ledger, Vec<Error>)[src]

Consuming self, returns a Ledger and the errors encountered during verifying accounts, calculating missing amounts or omitted cost basis information, checking balance assertions, and completing pad directives. If a directive causes an error with ErrorLevel::Error, it is dropped. In this case, the returned Ledger contains a subset of the information in self.

impl LedgerDraft[src]

pub fn add_option(
    &mut self,
    key: String,
    val: String,
    src: Source
) -> Result<(), Error>
[src]

Adds the value of an option into a LedgerDraft. Returns Err(Error) if the option key is already specified in self.

pub fn add_commodity(
    &mut self,
    commodity: Currency,
    meta: Meta,
    src: Source
) -> Result<(), Error>
[src]

Adds a type of commodity into a LedgerDraft. Returns Err(Error) if commodity is already in self.

impl LedgerDraft[src]

pub fn merge(&mut self, another: LedgerDraft) -> Vec<Error>[src]

Merges two LedgerDraft into one and returns errors detected, e.g., duplicated defections of accounts.

Trait Implementations

impl Clone for LedgerDraft[src]

impl Debug for LedgerDraft[src]

impl Default for LedgerDraft[src]

impl Eq for LedgerDraft[src]

impl PartialEq<LedgerDraft> for LedgerDraft[src]

impl StructuralEq for LedgerDraft[src]

impl StructuralPartialEq for LedgerDraft[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.