Trait snarkvm_utilities::bits::ToBits
source · pub trait ToBits: Sized {
// Required methods
fn to_bits_le(&self) -> Vec<bool>;
fn to_bits_be(&self) -> Vec<bool>;
}
Required Methods§
sourcefn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Returns self
as a boolean array in little-endian order.
sourcefn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns self
as a boolean array in big-endian order.
Implementations on Foreign Types§
source§impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7)
impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl ToBits for i32
impl ToBits for i32
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Returns self
as a boolean array in little-endian order.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns self
as a boolean array in big-endian order.
source§impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits> ToBits for &'a (C0, C1, C2, C3, C4, C5)
impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits> ToBits for &'a (C0, C1, C2, C3, C4, C5)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl ToBits for i128
impl ToBits for i128
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Returns self
as a boolean array in little-endian order.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns self
as a boolean array in big-endian order.
source§impl ToBits for i16
impl ToBits for i16
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Returns self
as a boolean array in little-endian order.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns self
as a boolean array in big-endian order.
source§impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7)
impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl ToBits for u64
impl ToBits for u64
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Returns self
as a boolean array in little-endian order.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns self
as a boolean array in big-endian order.
source§impl<'a, C0: ToBits, C1: ToBits, C2: ToBits> ToBits for &'a (C0, C1, C2)
impl<'a, C0: ToBits, C1: ToBits, C2: ToBits> ToBits for &'a (C0, C1, C2)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl ToBits for u128
impl ToBits for u128
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Returns self
as a boolean array in little-endian order.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns self
as a boolean array in big-endian order.
source§impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits, C8: ToBits, C9: ToBits> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)
impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits, C8: ToBits, C9: ToBits> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits, C8: ToBits, C9: ToBits, C10: ToBits> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits, C8: ToBits, C9: ToBits, C10: ToBits> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6)
impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl ToBits for u32
impl ToBits for u32
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Returns self
as a boolean array in little-endian order.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns self
as a boolean array in big-endian order.
source§impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits, C8: ToBits> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7, C8)
impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits, C8: ToBits> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7, C8)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits> ToBits for (C0, C1, C2, C3)
impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits> ToBits for (C0, C1, C2, C3)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl ToBits for i64
impl ToBits for i64
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Returns self
as a boolean array in little-endian order.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns self
as a boolean array in big-endian order.
source§impl<'a, C0: ToBits, C1: ToBits> ToBits for &'a (C0, C1)
impl<'a, C0: ToBits, C1: ToBits> ToBits for &'a (C0, C1)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl ToBits for i8
impl ToBits for i8
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Returns self
as a boolean array in little-endian order.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns self
as a boolean array in big-endian order.
source§impl<C: ToBits, const N: usize> ToBits for [C; N]
impl<C: ToBits, const N: usize> ToBits for [C; N]
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits.
source§impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits, C8: ToBits, C9: ToBits, C10: ToBits> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits, C8: ToBits, C9: ToBits, C10: ToBits> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl ToBits for String
impl ToBits for String
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits.
source§impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits> ToBits for (C0, C1, C2, C3, C4)
impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits> ToBits for (C0, C1, C2, C3, C4)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits> ToBits for &'a (C0, C1, C2, C3, C4)
impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits> ToBits for &'a (C0, C1, C2, C3, C4)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits, C8: ToBits, C9: ToBits> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)
impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits, C8: ToBits, C9: ToBits> ToBits for (C0, C1, C2, C3, C4, C5, C6, C7, C8, C9)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl ToBits for u16
impl ToBits for u16
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Returns self
as a boolean array in little-endian order.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns self
as a boolean array in big-endian order.
source§impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits> ToBits for (C0, C1, C2, C3, C4, C5)
impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits> ToBits for (C0, C1, C2, C3, C4, C5)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl<C0: ToBits, C1: ToBits, C2: ToBits> ToBits for (C0, C1, C2)
impl<C0: ToBits, C1: ToBits, C2: ToBits> ToBits for (C0, C1, C2)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl<C: ToBits> ToBits for &[C]
impl<C: ToBits> ToBits for &[C]
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits.
source§impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits> ToBits for (C0, C1, C2, C3, C4, C5, C6)
impl<C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits> ToBits for (C0, C1, C2, C3, C4, C5, C6)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl<C0: ToBits, C1: ToBits> ToBits for (C0, C1)
impl<C0: ToBits, C1: ToBits> ToBits for (C0, C1)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits, C8: ToBits> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7, C8)
impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits, C4: ToBits, C5: ToBits, C6: ToBits, C7: ToBits, C8: ToBits> ToBits for &'a (C0, C1, C2, C3, C4, C5, C6, C7, C8)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits> ToBits for &'a (C0, C1, C2, C3)
impl<'a, C0: ToBits, C1: ToBits, C2: ToBits, C3: ToBits> ToBits for &'a (C0, C1, C2, C3)
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
A helper method to return a concatenated list of little-endian bits from the circuits.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
A helper method to return a concatenated list of big-endian bits from the circuits.
source§impl ToBits for u8
impl ToBits for u8
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Returns self
as a boolean array in little-endian order.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns self
as a boolean array in big-endian order.