Module token

Source

Structs§

EscapeError
EscapedStr
New-type around &str that indicates the string is an escaped JSON string. Provides functions for retrieving the string in either form.
Offset
Represents the location of a token

Enums§

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

Functions§

expect_blob_or_null
Expects a Token::ValueString or Token::ValueNull. If the value is a string, it interprets it as a base64 encoded [Blob] value.
expect_bool_or_null
Expects a Token::ValueBool or Token::ValueNull, and returns the bool value if it’s not null.
expect_document
Expects and parses a complete document value.
expect_number_or_null
Expects a Token::ValueString, Token::ValueNumber or Token::ValueNull.
expect_start_array
Expects a Token::StartArray token and returns an error if it’s not present.
expect_start_object
Expects a Token::StartObject token and returns an error if it’s not present.
expect_string_or_null
Expects a Token::ValueString or Token::ValueNull, and returns the EscapedStr value if it’s not null.
expect_timestamp_or_null
Expects a Token::ValueNull, Token::ValueString, or Token::ValueNumber depending on the passed in timestamp_format. If there is a non-null value, it interprets it as an [DateTime ] in the requested format.
skip_to_end
Assumes a start object/array token has already been consumed and skips tokens until until its corresponding end object/array token is found.
skip_value
Skips an entire value in the token stream. Errors if it isn’t a value.