w3f_bls::serialize

Trait SerializableToBytes

Source
pub trait SerializableToBytes: CanonicalSerialize + CanonicalDeserialize {
    const SERIALIZED_BYTES_SIZE: usize;

    // Provided methods
    fn to_bytes(&self) -> Vec<u8> { ... }
    fn from_bytes(bytes: &[u8]) -> Result<Self, SerializationError> { ... }
}
Expand description

Serialization code that is used by multiple modules.

Required Associated Constants§

Provided Methods§

Source

fn to_bytes(&self) -> Vec<u8>

Source

fn from_bytes(bytes: &[u8]) -> Result<Self, SerializationError>

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<E: EngineBLS> SerializableToBytes for DoublePublicKey<E>

Serialization for DoublePublickey

Source§

impl<E: EngineBLS> SerializableToBytes for DoubleSignature<E>

Serialization for DoubleSignature

Source§

impl<E: EngineBLS> SerializableToBytes for NuggetBLSPoP<E>

Serialization for DoublePublickey

Source§

const SERIALIZED_BYTES_SIZE: usize = E::SIGNATURE_SERIALIZED_SIZE

Source§

impl<E: EngineBLS> SerializableToBytes for NuggetBLSnCPPoP<E>

Serialization for NuggetBLSnCPPoP

Source§

const SERIALIZED_BYTES_SIZE: usize = <DoubleSignature<E> as SerializableToBytes>::SERIALIZED_BYTES_SIZE

Source§

impl<E: EngineBLS> SerializableToBytes for PublicKey<E>

Source§

const SERIALIZED_BYTES_SIZE: usize = E::PUBLICKEY_SERIALIZED_SIZE

Source§

impl<E: EngineBLS> SerializableToBytes for SecretKey<E>

Source§

const SERIALIZED_BYTES_SIZE: usize = E::SECRET_KEY_SIZE

Source§

impl<E: EngineBLS> SerializableToBytes for SecretKeyVT<E>

Source§

const SERIALIZED_BYTES_SIZE: usize = E::SECRET_KEY_SIZE

Source§

impl<E: EngineBLS> SerializableToBytes for Signature<E>

Source§

const SERIALIZED_BYTES_SIZE: usize = E::SIGNATURE_SERIALIZED_SIZE