[−][src]Crate json_in_type
json_in_type is a library for very fast JSON serialization. It does only serialization, not parsing.
Principles
This library is fast at runtime because it tries to do more at compile time, using rust's powerful type system, and macros.
The base idea when starting to write this library was that a json object with a number of properties that is known at compile-time can be efficiently stored in an ad-hoc type, that will have a compact representation in memory, and will be serialized much faster than a HashMap.
How to use
This crate has two main macros, json_object!
,
and json_list!
.
Use them to create json values, that you can then serialize.
Modules
base_types | Serialization of numbers, booleans, and null |
list | Serialization to JSON lists like |
object | Serialization to JSON objects like |
string | Serialization to JSON strings like |
utils | Useful tools when working with the types in this crate |
Macros
json_list | Creates a static json list that can be serialized very fast.
Returns a struct implementing |
json_object | Creates a static json object that can be serialized very fast.
Returns a struct implementing |
Structs
JSON | Encapsulates a JSONValue and implements useful traits. |
Traits
JSONValue | A trait implemented by types that can be serialized to JSON |