Crate facet_json

Source
Expand description

Facet logo - a reflection library for Rust

Coverage Status free of syn crates.io documentation MIT/Apache-2.0 licensed

Logo by Misiasart

Thanks to all individual and corporate sponsors, without whom this work could not exist:

Ko-fi GitHub Sponsors Patreon Zed Depot

JSON serialization and deserialization for facet.

§Usage

Don’t use it! Duh.

(No but for real it’s being rewritten)

§License

Licensed under either of:

at your option.

Structs§

JsonError
A JSON parse error, with context. Never would’ve guessed huh.
Span
A span in the input, with a start position and length
Spanned
A value of type T annotated with its Span
TokenError
Error encountered during tokenization
Tokenizer
Simple JSON tokenizer producing spanned tokens from byte input.

Enums§

JsonErrorKind
An error kind for JSON parsing.
Token
JSON tokens (without positions)
TokenErrorKind
Types of errors that can occur during tokenization

Functions§

from_slice
Deserialize JSON from a slice
from_slice_wip
Deserialize a JSON string into a Wip object.
from_str
Deserializes a JSON string into a value of type T that implements Facet.
peek_to_string
Serializes a Peek instance to JSON
peek_to_writer
Serializes a Peek instance to a writer in JSON format
to_string
Serializes a value to JSON
to_writer
Serializes a value to a writer in JSON format

Type Aliases§

Pos
Position in the input (byte index)
TokenizeResult
Tokenization result, yielding a spanned token