pub enum JsonElementType {
Show 26 variants
Root,
Value,
Object,
Array,
String,
Number,
Boolean,
Null,
ObjectEntry,
ArrayElement,
ErrorNode,
LeftBrace,
RightBrace,
LeftBracket,
RightBracket,
Comma,
Colon,
StringLiteral,
NumberLiteral,
BooleanLiteral,
NullLiteral,
BareKey,
Whitespace,
Comment,
Eof,
Error,
}Expand description
Element types for the JSON parser.
Variants§
Root
Root node of the JSON document.
Value
A JSON value.
Object
A JSON object.
Array
A JSON array.
String
A JSON string.
Number
A JSON number.
Boolean
A JSON boolean.
Null
A JSON null value.
ObjectEntry
An entry in a JSON object.
ArrayElement
An element in a JSON array.
ErrorNode
An error node in the parse tree.
LeftBrace
Left brace {.
RightBrace
Right brace }.
LeftBracket
Left bracket [.
RightBracket
Right bracket ].
Comma
Comma ,.
Colon
Colon :.
StringLiteral
A string literal.
NumberLiteral
A number literal.
BooleanLiteral
A boolean literal (true or false).
NullLiteral
A null literal (null).
BareKey
A bare key (used in some JSON variants).
Whitespace
Whitespace (spaces, tabs, newlines).
Comment
A comment.
Eof
End of stream.
Error
An error element.
Trait Implementations§
Source§impl Clone for JsonElementType
impl Clone for JsonElementType
Source§fn clone(&self) -> JsonElementType
fn clone(&self) -> JsonElementType
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 Debug for JsonElementType
impl Debug for JsonElementType
Source§impl<'de> Deserialize<'de> for JsonElementType
impl<'de> Deserialize<'de> for JsonElementType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl ElementType for JsonElementType
impl ElementType for JsonElementType
Source§type Role = UniversalElementRole
type Role = UniversalElementRole
The associated role type for this element kind.
Source§fn is_role(&self, role: Self::Role) -> bool
fn is_role(&self, role: Self::Role) -> bool
Returns true if this element matches the specified language-specific role.
Source§fn is_universal(&self, role: UniversalElementRole) -> bool
fn is_universal(&self, role: UniversalElementRole) -> bool
Returns true if this element matches the specified universal role.
Source§impl From<JsonTokenType> for JsonElementType
impl From<JsonTokenType> for JsonElementType
Source§fn from(token: JsonTokenType) -> Self
fn from(token: JsonTokenType) -> Self
Converts to this type from the input type.
Source§impl Hash for JsonElementType
impl Hash for JsonElementType
Source§impl PartialEq for JsonElementType
impl PartialEq for JsonElementType
Source§impl Serialize for JsonElementType
impl Serialize for JsonElementType
impl Copy for JsonElementType
impl Eq for JsonElementType
impl StructuralPartialEq for JsonElementType
Auto Trait Implementations§
impl Freeze for JsonElementType
impl RefUnwindSafe for JsonElementType
impl Send for JsonElementType
impl Sync for JsonElementType
impl Unpin for JsonElementType
impl UnsafeUnpin for JsonElementType
impl UnwindSafe for JsonElementType
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