pub trait Format { }
Expand description
Specify how to serialize/deserialize a type
The format specifier allows to configure how a value is serialized/deserialized.
For example, you can serialize a timestamp as an integer using the UNIX epoch, as a string containing an integer, or as a string using ISO 8601.
This Format
traits allows more flexibility in configuring the format without the need to create a new type for each case.
Implementations on Foreign Types§
impl Format for bool
Serialize into a bool
impl Format for f32
Serialize into a f32
impl Format for f64
Serialize into a f64
impl Format for i8
Serialize into an i8
impl Format for i16
Serialize into an i16
impl Format for i32
Serialize into an i32
impl Format for i64
Serialize into an i64
impl Format for i128
Serialize into an i128
impl Format for u8
Serialize into a u8
impl Format for u16
Serialize into a u16
impl Format for u32
Serialize into a u32
impl Format for u64
Serialize into a u64
impl Format for u128
Serialize into a u128
impl Format for String
Serialize into a String
Implementors§
impl Format for Lowercase
Use lowercase characters
impl Format for Padded
Emit padding during serialization.
impl Format for PreferMany
Use in combination with OneOrMany
. Always emit the list form.
impl Format for PreferOne
Use in combination with OneOrMany
. Emit single element for lists of size 1.
impl Format for Unpadded
Do not emit padding during serialization.
impl Format for Uppercase
Use uppercase characters