Enum beancount_parser::Directive
source · #[non_exhaustive]pub enum Directive<'a> {
Transaction(Transaction<'a>),
Price(Price<'a>),
Open(Open<'a>),
Close(Close<'a>),
Assertion(Assertion<'a>),
Include(Include),
Pad(Pad<'a>),
Commodity(Commodity<'a>),
Option(Option<'a>),
Event(Event<'a>),
}Expand description
A directive
A beancount file is made of directives.
By far the the most common directive is the Transaction.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Transaction(Transaction<'a>)
The Transaction directive
Price(Price<'a>)
The Price directive
Open(Open<'a>)
The Open account directive
Close(Close<'a>)
The Close account directive
Assertion(Assertion<'a>)
The Assertion (balance) account directive
Include(Include)
The Include directive
Pad(Pad<'a>)
The Pad directive
Commodity(Commodity<'a>)
Available on crate feature
unstable only.The Commodity directive
Option(Option<'a>)
Available on crate feature
unstable only.The Option directive
Event(Event<'a>)
Available on crate feature
unstable only.The Event directive
Implementations§
source§impl<'a> Directive<'a>
impl<'a> Directive<'a>
sourcepub fn as_transaction(&self) -> Option<&Transaction<'a>>
pub fn as_transaction(&self) -> Option<&Transaction<'a>>
Returns the Transaction reference if this directive is a transaction
See also Directive::into_transaction
sourcepub fn into_transaction(self) -> Option<Transaction<'a>>
pub fn into_transaction(self) -> Option<Transaction<'a>>
Convert into a Transaction if this directive is a transaction
See also Directive::as_transaction
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Directive<'a>
impl<'a> Send for Directive<'a>
impl<'a> Sync for Directive<'a>
impl<'a> Unpin for Directive<'a>
impl<'a> UnwindSafe for Directive<'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