Crate facet_json

Crate facet_json 

Source
Expand description

§facet-json

codecov crates.io documentation MIT/Apache-2.0 licensed Discord

§facet-json

A JSON deserializer based on facet-deserialize

§Sponsors

Thanks to all individual sponsors:

GitHub Sponsors Patreon

…along with corporate sponsors:

AWS Zed Depot

…without whom this work could not exist.

§Special thanks

The facet logo was drawn by Misiasart.

§License

Licensed under either of:

at your option.

Macros§

test_modes
See the main test_modes documentation above.

Structs§

AdapterError
Adapter error (wraps scanner errors).
Json
A wrapper type for JSON serialization and deserialization.
JsonDeserializer
JSON deserializer using recursive descent.
JsonError
Error type for JSON deserialization.
JsonReader
Streaming JSON reader that handles buffer management automatically.
RawJson
A raw JSON value that has not been parsed.
ScanBuffer
A refillable buffer for streaming JSON parsing.
ScanError
Scanner error
Scanner
JSON scanner state machine.
SerializeOptions
Options for JSON serialization.
SliceAdapter
Token adapter for slice-based parsing with fixed-size windowing.
Span
Source span with offset and length.
Spanned
A value with source span information.
SpannedAdapterToken
Spanned token with location information.
SpannedJsonToken
Spanned JSON token with location information
SpannedToken
Spanned token with location information

Enums§

AdapterErrorKind
Types of adapter errors.
AdapterToken
Token with decoded content, ready for deserialization.
JsonErrorKind
Specific error kinds for JSON deserialization
JsonToken
A materialized JSON token with its value decoded.
NumberHint
Hint about number format to guide parsing
ReaderError
Error from JSON reader operations
ScanErrorKind
Types of scanner errors
ScanToken
Token kinds with minimal data - strings/numbers are just indices into the buffer.
SerializeError
Serialization error for json, which cannot fail.

Traits§

JsonWrite
Re-export the Write trait from facet-core for backwards compatibility.
TokenSource
Trait for token sources that can be used by the deserializer.

Functions§

from_slice
Deserialize JSON from a byte slice into an owned type.
from_slice_borrowed
Deserialize JSON from a byte slice, allowing zero-copy borrowing.
from_str
Deserialize JSON from a UTF-8 string slice into an owned type.
from_str_borrowed
Deserialize JSON from a UTF-8 string slice, allowing zero-copy borrowing.
peek_to_string
Serializes a Peek instance to a JSON string.
peek_to_string_pretty
Serializes a Peek instance to a pretty-printed JSON string.
peek_to_string_with_options
Serializes a Peek instance to a JSON string with custom options.
peek_to_writer
Serializes a Peek value to JSON and writes it to the given writer.
peek_to_writer_pretty
Serializes a Peek value to pretty-printed JSON and writes it to the given writer.
peek_to_writer_std
Serializes a Peek value to JSON and writes it to a std::io::Write writer.
peek_to_writer_std_pretty
Serializes a Peek value to pretty-printed JSON and writes it to a std::io::Write writer.
peek_to_writer_std_with_options
Serializes a Peek value to JSON with custom options and writes it to a std::io::Write writer.
peek_to_writer_with_options
Serializes a Peek value to JSON with custom options and writes it to the given writer.
to_string
Serializes a value implementing Facet to a JSON string.
to_string_pretty
Serializes a value implementing Facet to a pretty-printed JSON string.
to_string_with_options
Serializes a value implementing Facet to a JSON string with custom options.
to_writer
Serializes a Facet value to JSON and writes it to the given writer.
to_writer_pretty
Serializes a Facet value to pretty-printed JSON and writes it to the given writer.
to_writer_std
Serializes a Facet value to JSON and writes it to a std::io::Write writer.
to_writer_std_pretty
Serializes a Facet value to pretty-printed JSON and writes it to a std::io::Write writer.
to_writer_std_with_options
Serializes a Facet value to JSON with custom options and writes it to a std::io::Write writer.
to_writer_with_options
Serializes a Facet value to JSON with custom options and writes it to the given writer.