Enum StrContext
#[non_exhaustive]pub enum StrContext {
Label(&'static str),
Expected(StrContextValue),
}Expand description
Additional parse context for [ContextError] added via Parser::context
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.
Label(&'static str)
Description of what is currently being parsed
Expected(StrContextValue)
Grammar item that was expected
Trait Implementations§
Source§impl<'i> AddContext<LocatingSlice<&'i str>, StrContext> for ParseStack<'i>
impl<'i> AddContext<LocatingSlice<&'i str>, StrContext> for ParseStack<'i>
Source§fn add_context(
self,
_input: &Input<'i>,
_token_start: &<Input<'i> as Stream>::Checkpoint,
context: StrContext,
) -> Self
fn add_context( self, _input: &Input<'i>, _token_start: &<Input<'i> as Stream>::Checkpoint, context: StrContext, ) -> Self
Add a new context entry to the current layer.
This provides backwards compatibility with winnow’s Parser::context API.
The StrContext is internally converted to our owned StringContext representation.
Entries are staged inside Self until the current layer is closed.
§impl Clone for StrContext
impl Clone for StrContext
§fn clone(&self) -> StrContext
fn clone(&self) -> StrContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for StrContext
impl Debug for StrContext
§impl Display for StrContext
impl Display for StrContext
impl Eq for StrContext
Source§impl From<StrContext> for StringContext
impl From<StrContext> for StringContext
Source§fn from(context: StrContext) -> Self
fn from(context: StrContext) -> Self
Converts to this type from the input type.
§impl PartialEq for StrContext
impl PartialEq for StrContext
impl StructuralPartialEq for StrContext
Auto Trait Implementations§
impl Freeze for StrContext
impl RefUnwindSafe for StrContext
impl Send for StrContext
impl Sync for StrContext
impl Unpin for StrContext
impl UnsafeUnpin for StrContext
impl UnwindSafe for StrContext
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