Crate json_in_type

Source
Expand description

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§

  • Serialization of numbers, booleans, and null
  • Serialization to JSON lists like [0,true,"x"]
  • Serialization to JSON objects like {"x":1,"y":null}
  • Serialization to JSON strings like "hello world \n"
  • Useful tools when working with the types in this crate

Macros§

  • Creates a static json list that can be serialized very fast. Returns a struct implementing JSONValue.
  • Creates a static json object that can be serialized very fast. Returns a struct implementing JSONValue.

Structs§

Traits§

  • A trait implemented by types that can be serialized to JSON