pub enum Event<'src> {
Show 16 variants
DocumentStart,
DocumentEnd,
ObjectStart {
span: Span,
separator: Separator,
},
ObjectEnd {
span: Span,
},
SequenceStart {
span: Span,
},
SequenceEnd {
span: Span,
},
EntryStart,
Key {
span: Span,
tag: Option<&'src str>,
payload: Option<Cow<'src, str>>,
kind: ScalarKind,
},
EntryEnd,
Scalar {
span: Span,
value: Cow<'src, str>,
kind: ScalarKind,
},
Unit {
span: Span,
},
TagStart {
span: Span,
name: &'src str,
},
TagEnd,
Comment {
span: Span,
text: &'src str,
},
DocComment {
span: Span,
text: &'src str,
},
Error {
span: Span,
kind: ParseErrorKind,
},
}Expand description
Events emitted by the parser.
Variants§
DocumentStart
Start of document.
DocumentEnd
End of document.
ObjectStart
Start of an object { ... }.
ObjectEnd
End of an object.
SequenceStart
Start of a sequence ( ... ).
SequenceEnd
End of a sequence.
EntryStart
Start of an entry (key-value pair).
Key
A key in an entry.
Keys can be scalars or unit, optionally tagged. Objects, sequences, and heredocs are not allowed as keys.
Fields
§
kind: ScalarKindKind of scalar used for the key. Only meaningful if payload is Some.
EntryEnd
End of an entry.
Scalar
A scalar value.
Fields
§
kind: ScalarKindKind of scalar.
Unit
Unit value @.
TagStart
Start of a tag @name.
TagEnd
End of a tag.
Comment
Line comment // ....
DocComment
Doc comment /// ....
Error
Parse error.
Trait Implementations§
impl<'src> Eq for Event<'src>
impl<'src> StructuralPartialEq for Event<'src>
Auto Trait Implementations§
impl<'src> Freeze for Event<'src>
impl<'src> RefUnwindSafe for Event<'src>
impl<'src> Send for Event<'src>
impl<'src> Sync for Event<'src>
impl<'src> Unpin for Event<'src>
impl<'src> UnwindSafe for Event<'src>
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