snarkvm_utilities::bits

Trait FromBits

Source
pub trait FromBits: Sized {
    // Required methods
    fn from_bits_le(bits: &[bool]) -> Result<Self>;
    fn from_bits_be(bits: &[bool]) -> Result<Self>;
}

Required Methods§

Source

fn from_bits_le(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in little-endian order.

Source

fn from_bits_be(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in big-endian order.

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.

Implementations on Foreign Types§

Source§

impl FromBits for i8

Source§

fn from_bits_le(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in little-endian order.

Source§

fn from_bits_be(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in big-endian order.

Source§

impl FromBits for i16

Source§

fn from_bits_le(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in little-endian order.

Source§

fn from_bits_be(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in big-endian order.

Source§

impl FromBits for i32

Source§

fn from_bits_le(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in little-endian order.

Source§

fn from_bits_be(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in big-endian order.

Source§

impl FromBits for i64

Source§

fn from_bits_le(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in little-endian order.

Source§

fn from_bits_be(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in big-endian order.

Source§

impl FromBits for i128

Source§

fn from_bits_le(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in little-endian order.

Source§

fn from_bits_be(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in big-endian order.

Source§

impl FromBits for u8

Source§

fn from_bits_le(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in little-endian order.

Source§

fn from_bits_be(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in big-endian order.

Source§

impl FromBits for u16

Source§

fn from_bits_le(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in little-endian order.

Source§

fn from_bits_be(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in big-endian order.

Source§

impl FromBits for u32

Source§

fn from_bits_le(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in little-endian order.

Source§

fn from_bits_be(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in big-endian order.

Source§

impl FromBits for u64

Source§

fn from_bits_le(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in little-endian order.

Source§

fn from_bits_be(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in big-endian order.

Source§

impl FromBits for u128

Source§

fn from_bits_le(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in little-endian order.

Source§

fn from_bits_be(bits: &[bool]) -> Result<Self>

Reads Self from a boolean array in big-endian order.

Implementors§