pub enum Item {
Single(Box<Node>),
Multiple(Vec<Item>),
ImportError(PathBuf, Error),
}
Expand description
An abstraction above Node to implement import
Variants§
Single(Box<Node>)
A single item in the current file
E.g. Node::Assignment
Multiple(Vec<Item>)
The expansion of a import
statement
Contains all items from the import
d file.
ImportError(PathBuf, Error)
Encapsulates errors on import
We can’t use normal Rust error handling techniques due to abstraction by rust-peg. Instead, embed an Item::ImportErrors on a import error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Item
impl !RefUnwindSafe for Item
impl Send for Item
impl Sync for Item
impl Unpin for Item
impl !UnwindSafe for Item
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