Struct ledger_rs_lib::journal::Journal
source · 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
impl Journal
pub fn new() -> Self
pub fn add_xact(&mut self, xact: Xact) -> XactIndex
pub fn add_post(&mut self, post: Post) -> PostIndex
pub fn get_account(&self, index: AccountIndex) -> &Account
sourcepub fn get_commodity(&self, index: NodeIndex) -> &Commodity
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.
pub fn get_post(&self, index: PostIndex) -> &Post
pub fn get_post_mut(&mut self, index: PostIndex) -> &mut Post
pub fn get_posts(&self, indices: &Vec<PostIndex>) -> Vec<&Post>
pub fn get_master_account(&self) -> &Account
pub fn get_master_account_mut(&mut self) -> &mut Account
pub fn get_xact_posts(&self, index: XactIndex) -> Vec<&Post>
pub fn register_account(&mut self, name: &str) -> Option<AccountIndex>
sourcepub fn find_or_create_account(
&mut self,
root_id: AccountIndex,
acct_name: &str,
auto_create: bool
) -> Option<AccountIndex>
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§
impl RefUnwindSafe for Journal
impl Send for Journal
impl Sync for Journal
impl Unpin for Journal
impl UnwindSafe for Journal
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more