pub(crate) struct Layer {
pub(crate) name: String,
pub(crate) start: usize,
pub(crate) contexts: Vec<StringContext>,
}Expand description
One level of nesting in our parsing stack.
A Layer is used as part of the ParseStack struct and created when any kind of parsing
error backtracks/bubbles up past a LayerParser.
All context messages are stored as owned Strings (see StringContext), so they may be
created at runtime, e.g. by our translation system.
Fields§
§name: StringName passed to LayerExt::layer.
start: usizeAbsolute byte offset where this layer’s parser began.
ParseStack::at represents the respective end to this pointer.
contexts: Vec<StringContext>Every context call collected within this layer, in order they were attached.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Layer
impl RefUnwindSafe for Layer
impl Send for Layer
impl Sync for Layer
impl Unpin for Layer
impl UnsafeUnpin for Layer
impl UnwindSafe for Layer
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