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§
const SERIALIZED_BYTES_SIZE: usize
Provided Methods§
fn to_bytes(&self) -> Vec<u8>
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>
impl<E: EngineBLS> SerializableToBytes for DoublePublicKey<E>
Serialization for DoublePublickey
const SERIALIZED_BYTES_SIZE: usize = _
Source§impl<E: EngineBLS> SerializableToBytes for DoubleSignature<E>
impl<E: EngineBLS> SerializableToBytes for DoubleSignature<E>
Serialization for DoubleSignature
const SERIALIZED_BYTES_SIZE: usize = _
Source§impl<E: EngineBLS> SerializableToBytes for NuggetBLSPoP<E>
impl<E: EngineBLS> SerializableToBytes for NuggetBLSPoP<E>
Serialization for DoublePublickey
const SERIALIZED_BYTES_SIZE: usize = E::SIGNATURE_SERIALIZED_SIZE
Source§impl<E: EngineBLS> SerializableToBytes for NuggetBLSnCPPoP<E>
impl<E: EngineBLS> SerializableToBytes for NuggetBLSnCPPoP<E>
Serialization for NuggetBLSnCPPoP