pub enum Token<'a> {
    StartArray {
        offset: Offset,
    },
    EndArray {
        offset: Offset,
    },
    ObjectKey {
        offset: Offset,
        key: EscapedStr<'a>,
    },
    StartObject {
        offset: Offset,
    },
    EndObject {
        offset: Offset,
    },
    ValueBool {
        offset: Offset,
        value: bool,
    },
    ValueNull {
        offset: Offset,
    },
    ValueNumber {
        offset: Offset,
        value: Number,
    },
    ValueString {
        offset: Offset,
        value: EscapedStr<'a>,
    },
}
Expand description

Enum representing the different JSON tokens that can be returned by crate::deserialize::json_token_iter.

Variants

StartArray

Fields

offset: Offset

EndArray

Fields

offset: Offset

ObjectKey

Fields

offset: Offset
key: EscapedStr<'a>

StartObject

Fields

offset: Offset

EndObject

Fields

offset: Offset

ValueBool

Fields

offset: Offset
value: bool

ValueNull

Fields

offset: Offset

ValueNumber

Fields

offset: Offset
value: Number

ValueString

Fields

offset: Offset
value: EscapedStr<'a>

Implementations

Builds an error from the token’s offset

Trait Implementations

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.