Module serde

Source
Expand description

Utilities for serializing and deserializing with serde.

These modules and functions can be combined with serde’s field attributes to better control how to serialize and deserialize colors. See each item’s examples for more details.

Modules§

as_array
Combines serialize_as_array and deserialize_as_array as a module for #[serde(with = "...")].
as_uint
Combines serialize_as_uint and deserialize_as_uint as a module for #[serde(with = "...")].

Functions§

deserialize_as_array
Deserialize a value from an array of its components.
deserialize_as_uint
Deserialize a value from an unsigned integer.
deserialize_with_optional_alpha
Deserialize a transparent color without requiring the alpha to be specified.
deserialize_with_optional_pre_alpha
Deserialize a premultiplied transparent color without requiring the alpha to be specified.
serialize_as_array
Serialize the value as an array of its components.
serialize_as_uint
Serialize the value as an unsigned integer.