Expand description
§facet-json
§facet-json
A JSON deserializer based on facet-deserialize
§Sponsors
Thanks to all individual sponsors:
…along with corporate sponsors:
…without whom this work could not exist.
§Special thanks
The facet logo was drawn by Misiasart.
§License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Macros§
- test_
modes - See the main
test_modesdocumentation above.
Structs§
- Adapter
Error - Adapter error (wraps scanner errors).
- Json
- A wrapper type for JSON serialization and deserialization.
- Json
Deserializer - JSON deserializer using recursive descent.
- Json
Error - Error type for JSON deserialization.
- Json
Reader - Streaming JSON reader that handles buffer management automatically.
- RawJson
- A raw JSON value that has not been parsed.
- Scan
Buffer - A refillable buffer for streaming JSON parsing.
- Scan
Error - Scanner error
- Scanner
- JSON scanner state machine.
- Serialize
Options - Options for JSON serialization.
- Slice
Adapter - Token adapter for slice-based parsing with fixed-size windowing.
- Span
- Source span with offset and length.
- Spanned
- A value with source span information.
- Spanned
Adapter Token - Spanned token with location information.
- Spanned
Json Token - Spanned JSON token with location information
- Spanned
Token - Spanned token with location information
Enums§
- Adapter
Error Kind - Types of adapter errors.
- Adapter
Token - Token with decoded content, ready for deserialization.
- Json
Error Kind - Specific error kinds for JSON deserialization
- Json
Token - A materialized JSON token with its value decoded.
- Number
Hint - Hint about number format to guide parsing
- Reader
Error - Error from JSON reader operations
- Scan
Error Kind - Types of scanner errors
- Scan
Token - Token kinds with minimal data - strings/numbers are just indices into the buffer.
- Serialize
Error - Serialization error for json, which cannot fail.
Traits§
- Json
Write - Re-export the
Writetrait from facet-core for backwards compatibility. - Token
Source - 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
Peekinstance to a JSON string. - peek_
to_ string_ pretty - Serializes a
Peekinstance to a pretty-printed JSON string. - peek_
to_ string_ with_ options - Serializes a
Peekinstance to a JSON string with custom options. - peek_
to_ writer - Serializes a
Peekvalue to JSON and writes it to the given writer. - peek_
to_ writer_ pretty - Serializes a
Peekvalue to pretty-printed JSON and writes it to the given writer. - peek_
to_ writer_ std - Serializes a
Peekvalue to JSON and writes it to astd::io::Writewriter. - peek_
to_ writer_ std_ pretty - Serializes a
Peekvalue to pretty-printed JSON and writes it to astd::io::Writewriter. - peek_
to_ writer_ std_ with_ options - Serializes a
Peekvalue to JSON with custom options and writes it to astd::io::Writewriter. - peek_
to_ writer_ with_ options - Serializes a
Peekvalue to JSON with custom options and writes it to the given writer. - to_
string - Serializes a value implementing
Facetto a JSON string. - to_
string_ pretty - Serializes a value implementing
Facetto a pretty-printed JSON string. - to_
string_ with_ options - Serializes a value implementing
Facetto a JSON string with custom options. - to_
writer - Serializes a
Facetvalue to JSON and writes it to the given writer. - to_
writer_ pretty - Serializes a
Facetvalue to pretty-printed JSON and writes it to the given writer. - to_
writer_ std - Serializes a
Facetvalue to JSON and writes it to astd::io::Writewriter. - to_
writer_ std_ pretty - Serializes a
Facetvalue to pretty-printed JSON and writes it to astd::io::Writewriter. - to_
writer_ std_ with_ options - Serializes a
Facetvalue to JSON with custom options and writes it to astd::io::Writewriter. - to_
writer_ with_ options - Serializes a
Facetvalue to JSON with custom options and writes it to the given writer.