pub trait FromBits: Sized {
// Required methods
fn from_bits_le(bits: &[bool]) -> Result<Self, Error>;
fn from_bits_be(bits: &[bool]) -> Result<Self, Error>;
}
Required Methods§
sourcefn from_bits_le(bits: &[bool]) -> Result<Self, Error>
fn from_bits_le(bits: &[bool]) -> Result<Self, Error>
Reads Self
from a boolean array in little-endian order.
sourcefn from_bits_be(bits: &[bool]) -> Result<Self, Error>
fn from_bits_be(bits: &[bool]) -> Result<Self, Error>
Reads Self
from a boolean array in big-endian order.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<E> FromBits for Scalar<E>where
E: Environment,
impl<E> FromBits for Scalar<E>where E: Environment,
source§fn from_bits_le(bits_le: &[bool]) -> Result<Scalar<E>, Error>
fn from_bits_le(bits_le: &[bool]) -> Result<Scalar<E>, Error>
Initializes a new scalar from a list of little-endian bits.
- If
bits_le
is longer thanE::Scalar::size_in_bits()
, the excess bits are enforced to be0
s. - If
bits_le
is shorter thanE::Scalar::size_in_bits()
, it is padded with0
s up to scalar size.