pub struct Tokenizer<'a> { /* private fields */ }Expand description
A struct for holding data about the string being parsed
Implementations§
Source§impl<'a> Tokenizer<'a>
impl<'a> Tokenizer<'a>
Sourcepub fn include(
&self,
element: Pair<'_, Rule>,
options: &CommonOpts,
commodities: &List<Currency>,
) -> Result<ParsedLedger, Box<dyn Error>>
pub fn include( &self, element: Pair<'_, Rule>, options: &CommonOpts, commodities: &List<Currency>, ) -> Result<ParsedLedger, Box<dyn Error>>
Handles include directive
Add the found file of files it it has wildcards in the pattern to the queue of files to process and process them. TODO this is a good place to include parallelism
Source§impl<'a> Tokenizer<'a>
impl<'a> Tokenizer<'a>
pub fn tokenize(&'a mut self, options: &CommonOpts) -> ParsedLedger
Sourcepub fn tokenize_with_currencies(
&'a mut self,
options: &CommonOpts,
defined_currencies: Option<&List<Currency>>,
) -> ParsedLedger
pub fn tokenize_with_currencies( &'a mut self, options: &CommonOpts, defined_currencies: Option<&List<Currency>>, ) -> ParsedLedger
Parses a string into a parsed ledger. It allows for recursion, i.e. the include keyword is properly handled
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Tokenizer<'a>
impl<'a> RefUnwindSafe for Tokenizer<'a>
impl<'a> Send for Tokenizer<'a>
impl<'a> Sync for Tokenizer<'a>
impl<'a> Unpin for Tokenizer<'a>
impl<'a> UnwindSafe for Tokenizer<'a>
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