pub enum EventKind<'src> {
Show 16 variants
DocumentStart,
DocumentEnd,
ObjectStart,
ObjectEnd,
SequenceStart,
SequenceEnd,
EntryStart,
Key {
tag: Option<&'src str>,
payload: Option<Cow<'src, str>>,
kind: ScalarKind,
},
EntryEnd,
Scalar {
value: Cow<'src, str>,
kind: ScalarKind,
},
Unit,
TagStart {
name: &'src str,
},
TagEnd,
Comment {
text: &'src str,
},
DocComment {
lines: Vec<&'src str>,
},
Error {
kind: ParseErrorKind,
},
}Expand description
The kind of event 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.
Unit
Unit value @.
TagStart
Start of a tag @name.
TagEnd
End of a tag.
Comment
Line comment // ....
DocComment
Doc comment /// ....
Error
Parse error.
Fields
§
kind: ParseErrorKindKind of error.
Trait Implementations§
impl<'src> Eq for EventKind<'src>
impl<'src> StructuralPartialEq for EventKind<'src>
Auto Trait Implementations§
impl<'src> Freeze for EventKind<'src>
impl<'src> RefUnwindSafe for EventKind<'src>
impl<'src> Send for EventKind<'src>
impl<'src> Sync for EventKind<'src>
impl<'src> Unpin for EventKind<'src>
impl<'src> UnsafeUnpin for EventKind<'src>
impl<'src> UnwindSafe for EventKind<'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