Module serialization

Source
Expand description

Contains the trait serialization::SerializableElementRing for rings whose elements can be serialized by using serde.

It also contains some utilities to simplify this, since it is usually not possible to use #[derive(Serialize, Deserialize)] to implement serialization - the reason is that serialization and deserialization usually require access to the ring. Hence, we need to use serde::de::DeserializeSeed, but this is incompatible with #[derive]

Modules§

generic_tests
Availability

Structs§

DeserializeSeedNewtype
Availability
DeserializeSeedSeq
A DeserializeSeed that deserializes a sequence by deserializing every element according to some derived DeserializeSeed. The resulting elements are collected using a custom reducer function, akin to Iterator::fold().
DeserializeWithRing
Wrapper of a ring that implements [serde::DeserializationSeed] by trying to deserialize an element w.r.t. the wrapped ring.
SerializableNewtype
Availability
SerializableSeq
Wraps a VectorFn whose elements are Serializeable, and allows to serialize all elements as a sequence.
SerializeOwnedWithRing
Wraps a ring and a one of its elements. Implements serde::Serialize and will serialize the element w.r.t. the ring.
SerializeWithRing
Wraps a ring and a reference to one of its elements. Implements serde::Serialize and will serialize the element w.r.t. the ring.

Traits§

SerializableElementRing
Trait for rings whose elements can be serialized.