Expand description
JSON: text in, text out.
The entry points here are re-exported at the crate root, since JSON is the
format most callers reach for first. structio::from_str and
structio::json::from_str are the same function.
For the binary format that reads and writes the same structs, see
beve.
Re-exports§
pub use impls::FromJsonKey;pub use impls::ToJsonKey;pub use minify::minify;pub use minify::minify_into;pub use minify::minify_into_with;pub use minify::minify_with;pub use parser::JsonStr;pub use parser::Parser;pub use prettify::prettify;pub use prettify::prettify_into;pub use prettify::prettify_into_with;pub use prettify::prettify_with;pub use stream::Documents;pub use stream::Feed;pub use stream::Iter;pub use stream::Mode;pub use stream::from_reader;pub use stream::from_reader_with;pub use stream::to_writer;pub use stream::to_writer_buffered;pub use stream::to_writer_buffered_with;pub use stream::to_writer_with;pub use writer::Writer;pub use writer::quoted_key;
Modules§
- impls
ReadandWritefor the standard library’s types.- minify
- Taking the whitespace back out of JSON text.
- parser
- The parse cursor.
- prettify
- Laying out JSON text that is already JSON.
- stream
- Reading and writing JSON that does not fit, or has not arrived.
- writer
- The output buffer.
Traits§
- Read
- A type that can be parsed from JSON.
- Read
Array - Element-by-element reading for a struct written as a JSON array.
- ReadAs
- How a field of type
Tis read when its declaration names this adapter. - Read
Enum - Variant-by-variant reading for an enum.
- Read
KeyAs - How a map key of type
Tis read when its declaration names this adapter. - Read
Object - Field-by-field reading for a struct.
- Read
Write - Convenience bound for generic containers: readable from any JSON input, and writable.
- Write
- A type that can be serialized to JSON.
- Write
Array - Element-by-element writing for a struct written as a JSON array.
- WriteAs
- How a field of type
Tis written when its declaration names this adapter. - Write
KeyAs - How a map key of type
Tis written when its declaration names this adapter. - Write
Object - Field-by-field writing for a struct.
Functions§
- from_
slice - Parse a JSON document given as bytes.
- from_
slice_ with from_sliceunder an explicit read policy.- from_
str - Parse a JSON document into a new value.
- from_
str_ with from_strunder an explicit read policy.- read_
into - Parse a JSON document into an existing value.
- read_
into_ with read_intounder an explicit read policy.- to_
string - Serialize a value to a
String. - to_
string_ with to_stringunder an explicit write policy.- to_vec
- Serialize to a byte vector.
- to_
vec_ with to_vecunder an explicit write policy.- write_
into - Serialize into an existing
String, replacing its contents and keeping its allocation. - write_
into_ with write_intounder an explicit write policy.