pub enum JsonFragment {
BeginObject,
ObjectProperty(String),
EndObject,
BeginArray,
EndArray,
PrimitiveValue(JsonPrimitiveValue),
}
Expand description
A fragment of JSON. This is a bit more high-level than a token.
Variants§
BeginObject
Corresponds to {
. Always followed by JsonFragment::ObjectProperty
or JsonFragment::EndObject
.
The span includes only the single opening brace byte.
ObjectProperty(String)
The name of the current property. Always followed by the value of this property.
The span goes from the starting quote to after the colon.
EndObject
Corresponds to }
.
The span includes only the single closing brace byte.
BeginArray
Corresponds to [
. Always followed by the first element or by JsonFragment::EndArray
.
The span includes only the single opening bracket byte.
EndArray
Corresponds to ]
.
The span includes only the single closing bracket byte.
PrimitiveValue(JsonPrimitiveValue)
Any JSON value that’s not an object or an array.
The span encloses the value.
Trait Implementations§
Source§impl Clone for JsonFragment
impl Clone for JsonFragment
Source§fn clone(&self) -> JsonFragment
fn clone(&self) -> JsonFragment
Returns a copy 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 Debug for JsonFragment
impl Debug for JsonFragment
Source§impl PartialEq for JsonFragment
impl PartialEq for JsonFragment
impl StructuralPartialEq for JsonFragment
Auto Trait Implementations§
impl Freeze for JsonFragment
impl RefUnwindSafe for JsonFragment
impl Send for JsonFragment
impl Sync for JsonFragment
impl Unpin for JsonFragment
impl UnwindSafe for JsonFragment
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