pub enum Event {
StartObject,
EndObject,
StartArray,
EndArray,
Key(JsonStr),
String(JsonStr),
Number(JsonNum),
Bool(bool),
Null,
}Expand description
A single event from the streaming parser.
The parser emits these in document order. Containers are delimited by
matched Start*/End* pairs. Inside an object, every value event is
preceded by a Key event for that field.
Event is 16 bytes — (JsonStr|JsonNum: 8 bytes) + (tag: 1 byte) + 7 bytes padding. This fits in one xmm register, so next_event returns
it without spilling to the stack — measurable in profiles as ~12% of
typed-parse runtime saved compared to the previous 32-byte representation.
Variants§
StartObject
EndObject
StartArray
EndArray
Key(JsonStr)
String(JsonStr)
Number(JsonNum)
Bool(bool)
Null
Trait Implementations§
impl Copy for Event
impl Eq for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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