Struct snarkvm_console_types_field::Field
source · pub struct Field<E: Environment> { /* private fields */ }
Implementations§
source§impl<E: Environment> Field<E>
impl<E: Environment> Field<E>
sourcepub const SIZE_IN_BITS: usize = <E::Field>::SIZE_IN_BITS
pub const SIZE_IN_BITS: usize = <E::Field>::SIZE_IN_BITS
The field size in bits.
sourcepub const SIZE_IN_BYTES: usize = _
pub const SIZE_IN_BYTES: usize = _
The field size in bytes.
sourcepub const SIZE_IN_DATA_BITS: usize = <E::Field>::SIZE_IN_DATA_BITS
pub const SIZE_IN_DATA_BITS: usize = <E::Field>::SIZE_IN_DATA_BITS
The field capacity for data bits.
sourcepub fn new_domain_separator(domain: &str) -> Self
pub fn new_domain_separator(domain: &str) -> Self
Initializes a new field as a domain separator.
Trait Implementations§
source§impl<E: Environment> AddAssign<&Field<E>> for Field<E>
impl<E: Environment> AddAssign<&Field<E>> for Field<E>
source§fn add_assign(&mut self, other: &Field<E>)
fn add_assign(&mut self, other: &Field<E>)
Adds other
to self
.
source§impl<E: Environment> AddAssign<Field<E>> for Field<E>
impl<E: Environment> AddAssign<Field<E>> for Field<E>
source§fn add_assign(&mut self, other: Field<E>)
fn add_assign(&mut self, other: Field<E>)
Adds other
to self
.
source§impl<E: Environment> Compare<Field<E>> for Field<E>
impl<E: Environment> Compare<Field<E>> for Field<E>
source§fn is_less_than(&self, other: &Self) -> Self::Output
fn is_less_than(&self, other: &Self) -> Self::Output
Returns true
if self
is less than other
.
source§fn is_greater_than(&self, other: &Self) -> Self::Output
fn is_greater_than(&self, other: &Self) -> Self::Output
Returns true
if self
is greater than other
.
source§fn is_less_than_or_equal(&self, other: &Self) -> Self::Output
fn is_less_than_or_equal(&self, other: &Self) -> Self::Output
Returns true
if self
is less than or equal to other
.
source§fn is_greater_than_or_equal(&self, other: &Self) -> Self::Output
fn is_greater_than_or_equal(&self, other: &Self) -> Self::Output
Returns true
if self
is greater than or equal to other
.
type Output = Boolean<E>
source§impl<E: Environment> Debug for Field<E>
impl<E: Environment> Debug for Field<E>
source§impl<E: Environment> Deref for Field<E>
impl<E: Environment> Deref for Field<E>
source§impl<E: Environment> DerefMut for Field<E>
impl<E: Environment> DerefMut for Field<E>
source§impl<'de, E: Environment> Deserialize<'de> for Field<E>
impl<'de, E: Environment> Deserialize<'de> for Field<E>
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserializes the field from a string or bytes.
source§impl<E: Environment> Display for Field<E>
impl<E: Environment> Display for Field<E>
source§impl<E: Environment> Distribution<Field<E>> for Standard
impl<E: Environment> Distribution<Field<E>> for Standard
source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Field<E>
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Field<E>
T
, using rng
as the source of randomness.source§impl<E: Environment> DivAssign<&Field<E>> for Field<E>
impl<E: Environment> DivAssign<&Field<E>> for Field<E>
source§fn div_assign(&mut self, other: &Field<E>)
fn div_assign(&mut self, other: &Field<E>)
Divides self
by other
.
source§impl<E: Environment> DivAssign<Field<E>> for Field<E>
impl<E: Environment> DivAssign<Field<E>> for Field<E>
source§fn div_assign(&mut self, other: Field<E>)
fn div_assign(&mut self, other: Field<E>)
Divides self
by other
.
source§impl<E: Environment> Double for Field<E>
impl<E: Environment> Double for Field<E>
source§impl<E: Environment> FromBits for Field<E>
impl<E: Environment> FromBits for Field<E>
source§fn from_bits_le(bits_le: &[bool]) -> Result<Self>
fn from_bits_le(bits_le: &[bool]) -> Result<Self>
Initializes a new field from a list of little-endian bits.
- If
bits_le
is longer thanE::Field::size_in_bits()
, the excess bits are enforced to be0
s. - If
bits_le
is shorter thanE::Field::size_in_bits()
, it is padded with0
s up to field size.
source§fn from_bits_be(bits_be: &[bool]) -> Result<Self>
fn from_bits_be(bits_be: &[bool]) -> Result<Self>
Initializes a new field from a list of big-endian bits without leading zeros.
source§impl<E: Environment> FromBytes for Field<E>
impl<E: Environment> FromBytes for Field<E>
source§impl<E: Environment> FromStr for Field<E>
impl<E: Environment> FromStr for Field<E>
source§impl<E: Environment> Inverse for Field<E>
impl<E: Environment> Inverse for Field<E>
source§impl<E: Environment> MulAssign<&Field<E>> for Field<E>
impl<E: Environment> MulAssign<&Field<E>> for Field<E>
source§fn mul_assign(&mut self, other: &Field<E>)
fn mul_assign(&mut self, other: &Field<E>)
Multiplies self
by other
.
source§impl<E: Environment> MulAssign<Field<E>> for Field<E>
impl<E: Environment> MulAssign<Field<E>> for Field<E>
source§fn mul_assign(&mut self, other: Field<E>)
fn mul_assign(&mut self, other: Field<E>)
Multiplies self
by other
.
source§impl<E: Environment> Neg for Field<E>
impl<E: Environment> Neg for Field<E>
source§impl<E: Environment> One for Field<E>
impl<E: Environment> One for Field<E>
source§impl<E: Environment> Ord for Field<E>
impl<E: Environment> Ord for Field<E>
source§impl<E: Environment> Parser for Field<E>
impl<E: Environment> Parser for Field<E>
source§fn parse(string: &str) -> ParserResult<'_, Self>
fn parse(string: &str) -> ParserResult<'_, Self>
Parses a string into a field circuit.
source§impl<E: PartialEq + Environment> PartialEq<Field<E>> for Field<E>where
E::Field: PartialEq,
impl<E: PartialEq + Environment> PartialEq<Field<E>> for Field<E>where E::Field: PartialEq,
source§impl<E: Environment> PartialOrd<Field<E>> for Field<E>
impl<E: Environment> PartialOrd<Field<E>> for Field<E>
source§fn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
Returns the lexicographic ordering of self
and other
.
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<E: Environment> Serialize for Field<E>
impl<E: Environment> Serialize for Field<E>
source§impl<E: Environment> SizeInBits for Field<E>
impl<E: Environment> SizeInBits for Field<E>
source§fn size_in_bits() -> usize
fn size_in_bits() -> usize
Returns the field size in bits.
source§impl<E: Environment> SizeInBytes for Field<E>
impl<E: Environment> SizeInBytes for Field<E>
source§fn size_in_bytes() -> usize
fn size_in_bytes() -> usize
Returns the field size in bytes.
source§impl<E: Environment> SizeInDataBits for Field<E>
impl<E: Environment> SizeInDataBits for Field<E>
source§fn size_in_data_bits() -> usize
fn size_in_data_bits() -> usize
Returns the field capacity for data bits.
source§impl<E: Environment> Square for Field<E>
impl<E: Environment> Square for Field<E>
source§impl<E: Environment> SquareRoot for Field<E>
impl<E: Environment> SquareRoot for Field<E>
source§impl<E: Environment> SubAssign<&Field<E>> for Field<E>
impl<E: Environment> SubAssign<&Field<E>> for Field<E>
source§fn sub_assign(&mut self, other: &Field<E>)
fn sub_assign(&mut self, other: &Field<E>)
Subtracts other
from self
.
source§impl<E: Environment> SubAssign<Field<E>> for Field<E>
impl<E: Environment> SubAssign<Field<E>> for Field<E>
source§fn sub_assign(&mut self, other: Field<E>)
fn sub_assign(&mut self, other: Field<E>)
Subtracts other
from self
.
source§impl<E: Environment> Ternary for Field<E>
impl<E: Environment> Ternary for Field<E>
source§impl<E: Environment> ToBits for Field<E>
impl<E: Environment> ToBits for Field<E>
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Outputs the little-endian bit representation of self
without trailing zeros.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Outputs the big-endian bit representation of self
without leading zeros.