SerializableElementGroup

Trait SerializableElementGroup 

Source
pub trait SerializableElementGroup: AbelianGroupBase {
    // Required methods
    fn deserialize<'de, D>(
        &self,
        deserializer: D,
    ) -> Result<Self::Element, D::Error>
       where D: Deserializer<'de>;
    fn serialize<S>(
        &self,
        el: &Self::Element,
        serializer: S,
    ) -> Result<S::Ok, S::Error>
       where S: Serializer;
}
Available on crate feature unstable-enable only.
Expand description

Trait for rings whose elements can be serialized.

Serialization and deserialization mostly follow the principles of the serde crate, with the main difference that ring elements cannot be serialized/deserialized on their own, but only w.r.t. a specific ring.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Required Methods§

Source

fn deserialize<'de, D>( &self, deserializer: D, ) -> Result<Self::Element, D::Error>
where D: Deserializer<'de>,

Deserializes an element of this ring from the given deserializer.

Source

fn serialize<S>( &self, el: &Self::Element, serializer: S, ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serializes an element of this ring to the given serializer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§