pub struct Journal {
    pub master: AccountIndex,
    pub commodity_pool: CommodityPool,
    pub xacts: Vec<Xact>,
    pub posts: Vec<Post>,
    pub accounts: Vec<Account>,
}

Fields§

§master: AccountIndex§commodity_pool: CommodityPool§xacts: Vec<Xact>§posts: Vec<Post>§accounts: Vec<Account>

Implementations§

source§

impl Journal

source

pub fn new() -> Self

source

pub fn add_xact(&mut self, xact: Xact) -> XactIndex

source

pub fn add_post(&mut self, post: Post) -> PostIndex

source

pub fn get_account(&self, index: AccountIndex) -> &Account

source

pub fn get_commodity(&self, index: NodeIndex) -> &Commodity

A convenience method that returns a vector of Account references for a given vector of indices, ie from Posts.

source

pub fn get_post(&self, index: PostIndex) -> &Post

source

pub fn get_post_mut(&mut self, index: PostIndex) -> &mut Post

source

pub fn get_posts(&self, indices: &Vec<PostIndex>) -> Vec<&Post>

source

pub fn get_master_account(&self) -> &Account

source

pub fn get_master_account_mut(&mut self) -> &mut Account

source

pub fn get_xact_posts(&self, index: XactIndex) -> Vec<&Post>

source

pub fn register_account(&mut self, name: &str) -> Option<AccountIndex>

source

pub fn find_or_create_account( &mut self, root_id: AccountIndex, acct_name: &str, auto_create: bool ) -> Option<AccountIndex>

Create an account tree from the account full-name.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.