Crate ser_write_json

source ·
Expand description

A JSON (compact) serde serializer for ser-write and a JSON deserializer for convenience.

Serializer types:

Serde type ->JSON type
()null
Unit structnull
boolboolean
NewType(T)T -> JSON
Nonenull
Some(T)T -> JSON
u8-u64number
i8-i64number
f23,f64number
strstring
bytes(configurable)
array, tuplearray
seq-likearray
map-likeobject
structobject
unit variantstring
newtype variant{"Name":T -> JSON}
tuple variant{"Name": array}
struct variant{"Name": object}

Deserializer supports self-describing formats (deserialize_any).

Deserializer deserializes structs from both JSON objects or arrays.

Deserializer types:

JSON type ->Serde type (depending on context)
nullunit,none,NaN
booleanbool
numberf64,f32,u8-u64,i8-i64
stringstr,bytes (configurable),enum variant
arrayarray,tuple,tuple struct,typle variant,seq-like,struct
objectenum variant,struct variant,map-like,struct
TNewType(JSON -> T), Some(JSON -> T)

Re-exports§

Modules§

  • Base-64 codec.
  • JSON serde deserializer
  • JSON compact serde serializer for ser-write

Traits§

  • Serializers should write data to the implementations of this trait.