SerializableElementRing

Trait SerializableElementRing 

Source
pub trait SerializableElementRing: RingBase {
    // 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§

Source§

impl SerializableElementRing for MPZBase

Available on crate feature mpir only.
Source§

impl SerializableElementRing for feanor_math::rings::zn::zn_64::ZnBase

Source§

impl<A: Allocator + Clone> SerializableElementRing for RustBigintRingBase<A>

Source§

impl<C: RingStore, J: RingStore, A: Allocator + Clone> SerializableElementRing for feanor_math::rings::zn::zn_rns::ZnBase<C, J, A>

Source§

impl<I> SerializableElementRing for RationalFieldBase<I>

Source§

impl<I: RingStore> SerializableElementRing for feanor_math::rings::zn::zn_big::ZnBase<I>

Source§

impl<R, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> SerializableElementRing for DensePolyRingBase<R, A, C>

Source§

impl<R, V, A, C> SerializableElementRing for FreeAlgebraImplBase<R, V, A, C>

Source§

impl<R: DelegateRing + ?Sized> SerializableElementRing for R

Source§

impl<R: RingStore, const N: usize> SerializableElementRing for DirectPowerRingBase<R, N>

Source§

impl<T: PrimitiveInt> SerializableElementRing for StaticRingBase<T>

Source§

impl<const N: u64, const IS_FIELD: bool> SerializableElementRing for feanor_math::rings::zn::zn_static::ZnBase<N, IS_FIELD>