Trait snarkvm_console_account::ToBits
pub trait ToBits: Sized {
// Required methods
fn write_bits_le(&self, vec: &mut Vec<bool>);
fn write_bits_be(&self, vec: &mut Vec<bool>);
// Provided methods
fn to_bits_le(&self) -> Vec<bool> { ... }
fn to_bits_be(&self) -> Vec<bool> { ... }
fn num_bits() -> Option<usize> { ... }
}
Required Methods§
fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
Writes self
into the given vector as a boolean array in little-endian order.
fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
Writes self
into the given vector as a boolean array in big-endian order.
Provided Methods§
fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Returns self
as a boolean array in little-endian order.
fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns self
as a boolean array in big-endian order.
Object Safety§
Implementations on Foreign Types§
§impl ToBits for bool
impl ToBits for bool
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits.
§impl ToBits for String
impl ToBits for String
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits.
§impl<'a, C0, C1> ToBits for &'a (C0, C1)
impl<'a, C0, C1> ToBits for &'a (C0, C1)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<'a, C0, C1, C2> ToBits for &'a (C0, C1, C2)
impl<'a, C0, C1, C2> ToBits for &'a (C0, C1, C2)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<'a, C0, C1, C2, C3> ToBits for &'a (C0, C1, C2, C3)
impl<'a, C0, C1, C2, C3> ToBits for &'a (C0, C1, C2, C3)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<'a, C0, C1, C2, C3, C4> ToBits for &'a (C0, C1, C2, C3, C4)
impl<'a, C0, C1, C2, C3, C4> ToBits for &'a (C0, C1, C2, C3, C4)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<'a, C0, C1, C2, C3, C4, C5> ToBits for &'a (C0, C1, C2, C3, C4, C5)
impl<'a, C0, C1, C2, C3, C4, C5> ToBits for &'a (C0, C1, C2, C3, C4, C5)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<'a, C0, C1, C2, C3, C4, C5, C6> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6)
impl<'a, C0, C1, C2, C3, C4, C5, C6> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<'a, C0, C1, C2, C3, C4, C5, C6, C7> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7)
impl<'a, C0, C1, C2, C3, C4, C5, C6, C7> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<'a, C0, C1, C2, C3, C4, C5, C6, C7, C8> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7, C8)
impl<'a, C0, C1, C2, C3, C4, C5, C6, C7, C8> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7, C8)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<'a, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)
impl<'a, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<'a, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
impl<'a, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<C0, C1> ToBits for (C0, C1)
impl<C0, C1> ToBits for (C0, C1)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<C0, C1, C2> ToBits for (C0, C1, C2)
impl<C0, C1, C2> ToBits for (C0, C1, C2)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<C0, C1, C2, C3> ToBits for (C0, C1, C2, C3)
impl<C0, C1, C2, C3> ToBits for (C0, C1, C2, C3)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<C0, C1, C2, C3, C4> ToBits for (C0, C1, C2, C3, C4)
impl<C0, C1, C2, C3, C4> ToBits for (C0, C1, C2, C3, C4)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<C0, C1, C2, C3, C4, C5> ToBits for (C0, C1, C2, C3, C4, C5)
impl<C0, C1, C2, C3, C4, C5> ToBits for (C0, C1, C2, C3, C4, C5)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<C0, C1, C2, C3, C4, C5, C6> ToBits for (C0, C1, C2, C3, C4, C5, C6)
impl<C0, C1, C2, C3, C4, C5, C6> ToBits for (C0, C1, C2, C3, C4, C5, C6)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<C0, C1, C2, C3, C4, C5, C6, C7> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7)
impl<C0, C1, C2, C3, C4, C5, C6, C7> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<C0, C1, C2, C3, C4, C5, C6, C7, C8> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7, C8)
impl<C0, C1, C2, C3, C4, C5, C6, C7, C8> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7, C8)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)
impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits from the circuits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits from the circuits.
§impl<C> ToBits for &[C]where
C: ToBits,
impl<C> ToBits for &[C]where
C: ToBits,
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits.
§impl<C> ToBits for Vec<C>where
C: ToBits,
impl<C> ToBits for Vec<C>where
C: ToBits,
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits.
§impl<C, const N: usize> ToBits for [C; N]where
C: ToBits,
impl<C, const N: usize> ToBits for [C; N]where
C: ToBits,
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of little-endian bits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
A helper method to return a concatenated list of big-endian bits.
§impl<E> ToBits for Boolean<E>where
E: Environment,
impl<E> ToBits for Boolean<E>where
E: Environment,
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
Outputs self
in a vector.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
Outputs self
in a vector.
§impl<E, I> ToBits for Integer<E, I>where
E: Environment,
I: IntegerType,
impl<E, I> ToBits for Integer<E, I>where
E: Environment,
I: IntegerType,
§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
Outputs the little-endian bit representation of self
without trailing zeros.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
Outputs the big-endian bit representation of self
without leading zeros.