pairing_plus::serdes

Trait SerDes

Source
pub trait SerDes: Sized {
    // Required methods
    fn serialize<W: Write>(
        &self,
        writer: &mut W,
        compressed: bool,
    ) -> Result<()>;
    fn deserialize<R: Read>(reader: &mut R, compressed: bool) -> Result<Self>;
}
Expand description

Serialization support for group elements.

Required Methods§

Source

fn serialize<W: Write>(&self, writer: &mut W, compressed: bool) -> Result<()>

Serialize a struct to a writer with a flag of compressness.

Source

fn deserialize<R: Read>(reader: &mut R, compressed: bool) -> Result<Self>

Deserialize a struct; give an indicator if the element was compressed or not. Returns an error is the encoding does not match the indicator.

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§