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. - Bool
From Int - Deserialize a boolean from a number
- Borrow
Cow - Borrow
Cow
data during deserialization when possible. - Bytes
- Optimized handling of owned and borrowed byte representations.
- Bytes
OrString - Deserialize from bytes or string
- Default
OnError - Deserialize value and return
Default
on error - Default
OnNull - Deserialize
Default
fromnull
values - Display
From Str - De/Serialize using
Display
andFromStr
implementation - Duration
Micro Seconds - Equivalent to
DurationSeconds
with micro-seconds as base unit. - Duration
Micro Seconds With Frac - Equivalent to
DurationSecondsWithFrac
with micro-seconds as base unit. - Duration
Milli Seconds - Equivalent to
DurationSeconds
with milli-seconds as base unit. - Duration
Milli Seconds With Frac - Equivalent to
DurationSecondsWithFrac
with milli-seconds as base unit. - Duration
Nano Seconds - Equivalent to
DurationSeconds
with nano-seconds as base unit. - Duration
Nano Seconds With Frac - Equivalent to
DurationSecondsWithFrac
with nano-seconds as base unit. - Duration
Seconds - De/Serialize Durations as number of seconds.
- Duration
Seconds With Frac - De/Serialize Durations as number of seconds.
- EnumMap
- Represent a list of enum values as a map.
- From
Into - Serialize value by converting to/from a proxy type with serde support.
- From
Into Ref - Serialize a reference value by converting to/from a proxy type with serde support.
- IfIs
Human Readable - Use the first format if
De/Serializer::is_human_readable
, otherwise use the second - KeyValue
Map - Convert
Vec
elements into key-value map entries - Map
- This serializes a list of tuples into a map
- MapFirst
KeyWins - Ensure that the first key is taken, if duplicate keys exist
- MapPrevent
Duplicates - Ensure no duplicate keys exist in a map.
- MapSkip
Error - Deserialize a map, skipping keys and values which fail to deserialize.
- None
AsEmpty String - De/Serialize a
Option<String>
type while transforming the empty string toNone
- OneOr
Many - Deserialize one or many elements
- Pick
First - 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
- SetLast
Value Wins - Ensure that the last value is taken, if duplicate values exist
- SetPrevent
Duplicates - Ensure no duplicate values exist in a set.
- String
With Separator - De/Serialize a delimited collection using
Display
andFromStr
implementation - Timestamp
Micro Seconds - Equivalent to
TimestampSeconds
with micro-seconds as base unit. - Timestamp
Micro Seconds With Frac - Equivalent to
TimestampSecondsWithFrac
with micro-seconds as base unit. - Timestamp
Milli Seconds - Equivalent to
TimestampSeconds
with milli-seconds as base unit. - Timestamp
Milli Seconds With Frac - Equivalent to
TimestampSecondsWithFrac
with milli-seconds as base unit. - Timestamp
Nano Seconds - Equivalent to
TimestampSeconds
with nano-seconds as base unit. - Timestamp
Nano Seconds With Frac - Equivalent to
TimestampSecondsWithFrac
with nano-seconds as base unit. - Timestamp
Seconds - De/Serialize timestamps as seconds since the UNIX epoch
- Timestamp
Seconds With Frac - De/Serialize timestamps as seconds since the UNIX epoch
- TryFrom
Into - Serialize value by converting to/from a proxy type with serde support.
- TryFrom
Into Ref - Serialize a reference value by converting to/from a proxy type with serde support.
- VecSkip
Error - 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.
- Deserialize
As - 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.
- Serialize
As - 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
- Deserialize
From Str - Deserialize value by using its
FromStr
implementation - Serialize
- Serialize
Display - Serialize value by using it’s
Display
implementation