Trait ToVariableLengthBytes

Source
pub trait ToVariableLengthBytes {
    type Output;
    type Error;

    // Required methods
    fn to_bytes_compressed_form(&self) -> Vec<u8> ;
    fn from_bytes_compressed_form<I: AsRef<[u8]>>(
        data: I,
    ) -> Result<Self::Output, Self::Error>;
    fn to_bytes_uncompressed_form(&self) -> Vec<u8> ;
    fn from_bytes_uncompressed_form<I: AsRef<[u8]>>(
        data: I,
    ) -> Result<Self::Output, Self::Error>;
}
Expand description

Trait for structs that have variable length bytes but use compressed Bls12 elements

Required Associated Types§

Source

type Output

The type that implements this trait

Source

type Error

The type of error to return

Required Methods§

Source

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

Convert to raw compressed bytes

Source

fn from_bytes_compressed_form<I: AsRef<[u8]>>( data: I, ) -> Result<Self::Output, Self::Error>

Convert from raw compressed bytes

Source

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

Convert to raw bytes

Source

fn from_bytes_uncompressed_form<I: AsRef<[u8]>>( data: I, ) -> Result<Self::Output, Self::Error>

Convert from raw bytes

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§