snarkvm_circuit_environment::traits

Trait ToBits

Source
pub trait ToBits {
    type Boolean: BooleanTrait;

    // Required methods
    fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>);
    fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>);

    // Provided methods
    fn to_bits_le(&self) -> Vec<Self::Boolean> { ... }
    fn to_bits_be(&self) -> Vec<Self::Boolean> { ... }
}
Expand description

Unary operator for converting to bits.

Required Associated Types§

Required Methods§

Source

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

Source

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

Provided Methods§

Source

fn to_bits_le(&self) -> Vec<Self::Boolean>

Returns the little-endian bits of the circuit.

Source

fn to_bits_be(&self) -> Vec<Self::Boolean>

Returns the big-endian bits of the circuit.

Implementations on Foreign Types§

Source§

impl<'a, B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>> ToBits for &'a (C0, C1)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<'a, B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>> ToBits for &'a (C0, C1, C2)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<'a, B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>> ToBits for &'a (C0, C1, C2, C3)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<'a, B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>, C4: ToBits<Boolean = B>> ToBits for &'a (C0, C1, C2, C3, C4)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<'a, B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>, C4: ToBits<Boolean = B>, C5: ToBits<Boolean = B>> ToBits for &'a (C0, C1, C2, C3, C4, C5)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<'a, B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>, C4: ToBits<Boolean = B>, C5: ToBits<Boolean = B>, C6: ToBits<Boolean = B>> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<'a, B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>, C4: ToBits<Boolean = B>, C5: ToBits<Boolean = B>, C6: ToBits<Boolean = B>, C7: ToBits<Boolean = B>> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<'a, B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>, C4: ToBits<Boolean = B>, C5: ToBits<Boolean = B>, C6: ToBits<Boolean = B>, C7: ToBits<Boolean = B>, C8: ToBits<Boolean = B>> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7, C8)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<'a, B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>, C4: ToBits<Boolean = B>, C5: ToBits<Boolean = B>, C6: ToBits<Boolean = B>, C7: ToBits<Boolean = B>, C8: ToBits<Boolean = B>, C9: ToBits<Boolean = B>> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<'a, B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>, C4: ToBits<Boolean = B>, C5: ToBits<Boolean = B>, C6: ToBits<Boolean = B>, C7: ToBits<Boolean = B>, C8: ToBits<Boolean = B>, C9: ToBits<Boolean = B>, C10: ToBits<Boolean = B>> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>> ToBits for (C0, C1)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>> ToBits for (C0, C1, C2)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>> ToBits for (C0, C1, C2, C3)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>, C4: ToBits<Boolean = B>> ToBits for (C0, C1, C2, C3, C4)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>, C4: ToBits<Boolean = B>, C5: ToBits<Boolean = B>> ToBits for (C0, C1, C2, C3, C4, C5)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>, C4: ToBits<Boolean = B>, C5: ToBits<Boolean = B>, C6: ToBits<Boolean = B>> ToBits for (C0, C1, C2, C3, C4, C5, C6)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>, C4: ToBits<Boolean = B>, C5: ToBits<Boolean = B>, C6: ToBits<Boolean = B>, C7: ToBits<Boolean = B>> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>, C4: ToBits<Boolean = B>, C5: ToBits<Boolean = B>, C6: ToBits<Boolean = B>, C7: ToBits<Boolean = B>, C8: ToBits<Boolean = B>> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7, C8)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>, C4: ToBits<Boolean = B>, C5: ToBits<Boolean = B>, C6: ToBits<Boolean = B>, C7: ToBits<Boolean = B>, C8: ToBits<Boolean = B>, C9: ToBits<Boolean = B>> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<B: BooleanTrait, C0: ToBits<Boolean = B>, C1: ToBits<Boolean = B>, C2: ToBits<Boolean = B>, C3: ToBits<Boolean = B>, C4: ToBits<Boolean = B>, C5: ToBits<Boolean = B>, C6: ToBits<Boolean = B>, C7: ToBits<Boolean = B>, C8: ToBits<Boolean = B>, C9: ToBits<Boolean = B>, C10: ToBits<Boolean = B>> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<C: ToBits<Boolean = B>, B: BooleanTrait> ToBits for &[C]

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<C: ToBits<Boolean = B>, B: BooleanTrait> ToBits for Vec<C>

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Source§

impl<C: ToBits<Boolean = B>, B: BooleanTrait, const N: usize> ToBits for [C; N]

Source§

fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of little-endian bits from the circuits.

Source§

fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)

A helper method to return a concatenated list of big-endian bits from the circuits.

Source§

type Boolean = B

Implementors§