Module ser

Source
Expand description

Serde-related exports.

Modules§

core
The Rust Core Library
de
Module for DeserializeAs implementations
formats
Specify the format and how lenient the deserialization is
rust
De/Serialization for Rust’s builtin and std types
ser
Module for SerializeAs implementations
serde
Serde
serde_derive
This crate provides Serde’s two derive macros.

Macros§

flattened_maybe
Support deserializing from flattened and non-flattened representation
serde_conv
Create new conversion adapters from functions
with_prefix
Serialize with an added prefix on every field name and deserialize by trimming away the prefix.
with_suffix
Serialize with an added suffix on every field name and deserialize by trimming away the suffix.

Structs§

As
Adapter to convert from serde_as to the serde traits.
BoolFromInt
Deserialize a boolean from a number
BorrowCow
Borrow Cow data during deserialization when possible.
Bytes
Optimized handling of owned and borrowed byte representations.
BytesOrString
Deserialize from bytes or string
DefaultOnError
Deserialize value and return Default on error
DefaultOnNull
Deserialize Default from null values
DisplayFromStr
De/Serialize using Display and FromStr implementation
DurationMicroSeconds
Equivalent to DurationSeconds with micro-seconds as base unit.
DurationMicroSecondsWithFrac
Equivalent to DurationSecondsWithFrac with micro-seconds as base unit.
DurationMilliSeconds
Equivalent to DurationSeconds with milli-seconds as base unit.
DurationMilliSecondsWithFrac
Equivalent to DurationSecondsWithFrac with milli-seconds as base unit.
DurationNanoSeconds
Equivalent to DurationSeconds with nano-seconds as base unit.
DurationNanoSecondsWithFrac
Equivalent to DurationSecondsWithFrac with nano-seconds as base unit.
DurationSeconds
De/Serialize Durations as number of seconds.
DurationSecondsWithFrac
De/Serialize Durations as number of seconds.
EnumMap
Represent a list of enum values as a map.
FromInto
Serialize value by converting to/from a proxy type with serde support.
FromIntoRef
Serialize a reference value by converting to/from a proxy type with serde support.
IfIsHumanReadable
Use the first format if De/Serializer::is_human_readable, otherwise use the second
KeyValueMap
Convert Vec elements into key-value map entries
Map
This serializes a list of tuples into a map
MapFirstKeyWins
Ensure that the first key is taken, if duplicate keys exist
MapPreventDuplicates
Ensure no duplicate keys exist in a map.
MapSkipError
Deserialize a map, skipping keys and values which fail to deserialize.
NoneAsEmptyString
De/Serialize a Option<String> type while transforming the empty string to None
OneOrMany
Deserialize one or many elements
PickFirst
Try multiple deserialization options until one succeeds.
Same
Adapter to convert from serde_as to the serde traits.
Seq
De/Serialize a Map into a list of tuples
SetLastValueWins
Ensure that the last value is taken, if duplicate values exist
SetPreventDuplicates
Ensure no duplicate values exist in a set.
StringWithSeparator
De/Serialize a delimited collection using Display and FromStr implementation
TimestampMicroSeconds
Equivalent to TimestampSeconds with micro-seconds as base unit.
TimestampMicroSecondsWithFrac
Equivalent to TimestampSecondsWithFrac with micro-seconds as base unit.
TimestampMilliSeconds
Equivalent to TimestampSeconds with milli-seconds as base unit.
TimestampMilliSecondsWithFrac
Equivalent to TimestampSecondsWithFrac with milli-seconds as base unit.
TimestampNanoSeconds
Equivalent to TimestampSeconds with nano-seconds as base unit.
TimestampNanoSecondsWithFrac
Equivalent to TimestampSecondsWithFrac with nano-seconds as base unit.
TimestampSeconds
De/Serialize timestamps as seconds since the UNIX epoch
TimestampSecondsWithFrac
De/Serialize timestamps as seconds since the UNIX epoch
TryFromInto
Serialize value by converting to/from a proxy type with serde support.
TryFromIntoRef
Serialize a reference value by converting to/from a proxy type with serde support.
VecSkipError
Deserialize a sequence into Vec<T>, skipping elements which fail to deserialize.

Traits§

Deserialize
A data structure that can be deserialized from any data format supported by Serde.
DeserializeAs
A data structure that can be deserialized from any data format supported by Serde, analogue to Deserialize.
Serialize
A data structure that can be serialized into any data format supported by Serde.
SerializeAs
A data structure that can be serialized into any data format supported by Serde, analogue to Serialize.

Attribute Macros§

apply
Apply attributes to all fields with matching types
serde_as
Convenience macro to use the serde_as system.
skip_serializing_none
Add skip_serializing_if annotations to [Option] fields.

Derive Macros§

Deserialize
DeserializeFromStr
Deserialize value by using its FromStr implementation
Serialize
SerializeDisplay
Serialize value by using it’s Display implementation