Module option

Module option 

Source
Available on crate feature serde only.
Expand description

Treat an Option<OffsetDateTime> as a Unix timestamp with microseconds for the purposes of serde.

Use this module in combination with serde’s #[with] attribute.

Note: Due to serde-rs/serde#2878, you will need to apply #[serde(default)] if you want a missing field to deserialize as None.

When deserializing, the offset is assumed to be UTC.

Functions§

deserialize
Deserialize an Option<OffsetDateTime> from its Unix timestamp with microseconds
serialize
Serialize an Option<OffsetDateTime> as its Unix timestamp with microseconds