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§
Required Methods§
Sourcefn to_bytes_compressed_form(&self) -> Vec<u8> ⓘ
fn to_bytes_compressed_form(&self) -> Vec<u8> ⓘ
Convert to raw compressed bytes
Sourcefn from_bytes_compressed_form<I: AsRef<[u8]>>(
data: I,
) -> Result<Self::Output, Self::Error>
fn from_bytes_compressed_form<I: AsRef<[u8]>>( data: I, ) -> Result<Self::Output, Self::Error>
Convert from raw compressed bytes
Sourcefn to_bytes_uncompressed_form(&self) -> Vec<u8> ⓘ
fn to_bytes_uncompressed_form(&self) -> Vec<u8> ⓘ
Convert to 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.