Trait ark_serialize::Flags[][src]

pub trait Flags: Default + Clone + Copy + Sized {
    const BIT_SIZE: usize;

    fn u8_bitmask(&self) -> u8;
fn from_u8(value: u8) -> Option<Self>; fn from_u8_remove_flags(value: &mut u8) -> Option<Self> { ... } }

Represents metadata to be appended to an object’s serialization. For example, when serializing elliptic curve points, one can use a Flag to represent whether the serialization is the point at infinity, or whether the y coordinate is positive or not. These bits will be appended to the end of the point’s serialization, or included in a new byte, depending on space available.

This is meant to be provided to CanonicalSerializeWithFlags and CanonicalDeserializeWithFlags

Associated Constants

const BIT_SIZE: usize[src]

The number of bits required to encode Self. This should be at most 8.

Loading content...

Required methods

fn u8_bitmask(&self) -> u8[src]

fn from_u8(value: u8) -> Option<Self>[src]

Loading content...

Provided methods

fn from_u8_remove_flags(value: &mut u8) -> Option<Self>[src]

Loading content...

Implementors

impl Flags for EdwardsFlags[src]

impl Flags for SWFlags[src]

impl Flags for EmptyFlags[src]

Loading content...