serde_with::formats

Trait Format

Source
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§

Source§

impl Format for bool

Serialize into a bool

Source§

impl Format for f32

Serialize into a f32

Source§

impl Format for f64

Serialize into a f64

Source§

impl Format for i8

Serialize into an i8

Source§

impl Format for i16

Serialize into an i16

Source§

impl Format for i32

Serialize into an i32

Source§

impl Format for i64

Serialize into an i64

Source§

impl Format for i128

Serialize into an i128

Source§

impl Format for u8

Serialize into a u8

Source§

impl Format for u16

Serialize into a u16

Source§

impl Format for u32

Serialize into a u32

Source§

impl Format for u64

Serialize into a u64

Source§

impl Format for u128

Serialize into a u128

Source§

impl Format for String

Serialize into a String

Implementors§

Source§

impl Format for Lowercase

Use lowercase characters

Source§

impl Format for Padded

Emit padding during serialization.

Source§

impl Format for PreferMany

Use in combination with OneOrMany. Always emit the list form.

Source§

impl Format for PreferOne

Use in combination with OneOrMany. Emit single element for lists of size 1.

Source§

impl Format for Unpadded

Do not emit padding during serialization.

Source§

impl Format for Uppercase

Use uppercase characters