pub struct ParseEvent<'de> {
pub kind: ParseEventKind<'de>,
pub span: Span,
pub meta: Option<ValueMeta<'de>>,
}Expand description
Event emitted by a format parser while streaming through input.
Fields§
§kind: ParseEventKind<'de>The kind of event.
span: SpanSource span of this event in the input.
meta: Option<ValueMeta<'de>>Optional metadata (doc comments, type tags) attached to this value.
For most formats (JSON, TOML, etc.) this will be None. Formats like Styx
that support documentation comments and type tags on values will populate this.
Implementations§
Source§impl<'de> ParseEvent<'de>
impl<'de> ParseEvent<'de>
Sourcepub fn new(kind: ParseEventKind<'de>, span: Span) -> Self
pub fn new(kind: ParseEventKind<'de>, span: Span) -> Self
Create a new event with the given kind and span.
Sourcepub fn with_meta(
self,
f: impl FnOnce(ValueMetaBuilder<'de>) -> ValueMetaBuilder<'de>,
) -> Self
pub fn with_meta( self, f: impl FnOnce(ValueMetaBuilder<'de>) -> ValueMetaBuilder<'de>, ) -> Self
Trait Implementations§
Source§impl<'de> Clone for ParseEvent<'de>
impl<'de> Clone for ParseEvent<'de>
Source§fn clone(&self) -> ParseEvent<'de>
fn clone(&self) -> ParseEvent<'de>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de> Debug for ParseEvent<'de>
impl<'de> Debug for ParseEvent<'de>
Source§impl<'de> PartialEq for ParseEvent<'de>
impl<'de> PartialEq for ParseEvent<'de>
impl<'de> StructuralPartialEq for ParseEvent<'de>
Auto Trait Implementations§
impl<'de> Freeze for ParseEvent<'de>
impl<'de> RefUnwindSafe for ParseEvent<'de>
impl<'de> Send for ParseEvent<'de>
impl<'de> Sync for ParseEvent<'de>
impl<'de> Unpin for ParseEvent<'de>
impl<'de> UnsafeUnpin for ParseEvent<'de>
impl<'de> UnwindSafe for ParseEvent<'de>
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