Crate ser_write_json

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}
  • Serializer supports serializing map keys as JSON strings from integers, chars, bools and C-like enums.

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§

pub use ser::to_string;std or alloc
pub use ser::to_string_hex_bytes;std or alloc
pub use ser::to_string_base64_bytes;std or alloc
pub use ser::to_string_pass_bytes;std or alloc
pub use ser::to_writer_with_encoder;
pub use ser::to_writer;
pub use ser::to_writer_hex_bytes;
pub use ser::to_writer_base64_bytes;
pub use ser::to_writer_pass_bytes;
pub use de::from_mut_slice_with_decoder;
pub use de::from_mut_slice;
pub use de::from_mut_slice_hex_bytes;
pub use de::from_mut_slice_base64_bytes;
pub use ser_write;

Modules§

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

Traits§

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