Struct snarkvm_console_types_field::Field
source · [−]pub struct Field<E: Environment> { /* private fields */ }
Implementations
sourceimpl<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
sourceimpl<E: Environment> Add<&Field<E>> for Field<E>
impl<E: Environment> Add<&Field<E>> for Field<E>
sourceimpl<E: Environment> Add<Field<E>> for Field<E>
impl<E: Environment> Add<Field<E>> for Field<E>
sourceimpl<E: Environment> AddAssign<&Field<E>> for Field<E>
impl<E: Environment> AddAssign<&Field<E>> for Field<E>
sourcefn add_assign(&mut self, other: &Field<E>)
fn add_assign(&mut self, other: &Field<E>)
Adds other
to self
.
sourceimpl<E: Environment> AddAssign<Field<E>> for Field<E>
impl<E: Environment> AddAssign<Field<E>> for Field<E>
sourcefn add_assign(&mut self, other: Field<E>)
fn add_assign(&mut self, other: Field<E>)
Adds other
to self
.
sourceimpl<E: Environment> Compare<Field<E>> for Field<E>
impl<E: Environment> Compare<Field<E>> for Field<E>
sourcefn 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
.
sourcefn 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
.
sourcefn 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
.
sourcefn 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>
sourceimpl<E: Environment> Debug for Field<E>
impl<E: Environment> Debug for Field<E>
sourceimpl<E: Environment> Deref for Field<E>
impl<E: Environment> Deref for Field<E>
sourceimpl<'de, E: Environment> Deserialize<'de> for Field<E>
impl<'de, E: Environment> Deserialize<'de> for Field<E>
sourcefn 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.
sourceimpl<E: Environment> Display for Field<E>
impl<E: Environment> Display for Field<E>
sourceimpl<E: Environment> Distribution<Field<E>> for Standard
impl<E: Environment> Distribution<Field<E>> for Standard
sourcefn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Field<E>
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Field<E>
Generate a random value of T
, using rng
as the source of randomness.
sourcefn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
sourceimpl<E: Environment> Div<&Field<E>> for Field<E>
impl<E: Environment> Div<&Field<E>> for Field<E>
sourceimpl<E: Environment> Div<Field<E>> for Field<E>
impl<E: Environment> Div<Field<E>> for Field<E>
sourceimpl<E: Environment> DivAssign<&Field<E>> for Field<E>
impl<E: Environment> DivAssign<&Field<E>> for Field<E>
sourcefn div_assign(&mut self, other: &Field<E>)
fn div_assign(&mut self, other: &Field<E>)
Divides self
by other
.
sourceimpl<E: Environment> DivAssign<Field<E>> for Field<E>
impl<E: Environment> DivAssign<Field<E>> for Field<E>
sourcefn div_assign(&mut self, other: Field<E>)
fn div_assign(&mut self, other: Field<E>)
Divides self
by other
.
sourceimpl<E: Environment> Double for Field<E>
impl<E: Environment> Double for Field<E>
sourceimpl<E: Environment> Equal<Field<E>> for Field<E>
impl<E: Environment> Equal<Field<E>> for Field<E>
sourceimpl<E: Environment> FromBits for Field<E>
impl<E: Environment> FromBits for Field<E>
sourcefn 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.
sourcefn 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.
sourceimpl<E: Environment> FromBytes for Field<E>
impl<E: Environment> FromBytes for Field<E>
sourceimpl<E: Environment> FromStr for Field<E>
impl<E: Environment> FromStr for Field<E>
sourceimpl<E: Environment> Inverse for Field<E>
impl<E: Environment> Inverse for Field<E>
sourceimpl<E: Environment> Mul<&Field<E>> for Field<E>
impl<E: Environment> Mul<&Field<E>> for Field<E>
sourceimpl<E: Environment> Mul<Field<E>> for Field<E>
impl<E: Environment> Mul<Field<E>> for Field<E>
sourceimpl<E: Environment> MulAssign<&Field<E>> for Field<E>
impl<E: Environment> MulAssign<&Field<E>> for Field<E>
sourcefn mul_assign(&mut self, other: &Field<E>)
fn mul_assign(&mut self, other: &Field<E>)
Multiplies self
by other
.
sourceimpl<E: Environment> MulAssign<Field<E>> for Field<E>
impl<E: Environment> MulAssign<Field<E>> for Field<E>
sourcefn mul_assign(&mut self, other: Field<E>)
fn mul_assign(&mut self, other: Field<E>)
Multiplies self
by other
.
sourceimpl<E: Environment> Neg for Field<E>
impl<E: Environment> Neg for Field<E>
sourceimpl<E: Environment> One for Field<E>
impl<E: Environment> One for Field<E>
sourceimpl<E: Environment> Ord for Field<E>
impl<E: Environment> Ord for Field<E>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<E: Environment> Parser for Field<E>
impl<E: Environment> Parser for Field<E>
sourcefn parse(string: &str) -> ParserResult<'_, Self>
fn parse(string: &str) -> ParserResult<'_, Self>
Parses a string into a field circuit.
sourceimpl<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,
sourceimpl<E: Environment> PartialOrd<Field<E>> for Field<E>
impl<E: Environment> PartialOrd<Field<E>> for Field<E>
sourcefn 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 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<E: Environment> Pow<&Field<E>> for Field<E>
impl<E: Environment> Pow<&Field<E>> for Field<E>
sourceimpl<E: Environment> Pow<Field<E>> for Field<E>
impl<E: Environment> Pow<Field<E>> for Field<E>
sourceimpl<'a, E: Environment> Product<&'a Field<E>> for Field<E>
impl<'a, E: Environment> Product<&'a Field<E>> for Field<E>
sourceimpl<E: Environment> Product<Field<E>> for Field<E>
impl<E: Environment> Product<Field<E>> for Field<E>
sourceimpl<E: Environment> Serialize for Field<E>
impl<E: Environment> Serialize for Field<E>
sourceimpl<E: Environment> SizeInBits for Field<E>
impl<E: Environment> SizeInBits for Field<E>
sourcefn size_in_bits() -> usize
fn size_in_bits() -> usize
Returns the field size in bits.
sourceimpl<E: Environment> SizeInBytes for Field<E>
impl<E: Environment> SizeInBytes for Field<E>
sourcefn size_in_bytes() -> usize
fn size_in_bytes() -> usize
Returns the field size in bytes.
sourceimpl<E: Environment> SizeInDataBits for Field<E>
impl<E: Environment> SizeInDataBits for Field<E>
sourcefn size_in_data_bits() -> usize
fn size_in_data_bits() -> usize
Returns the field capacity for data bits.
sourceimpl<E: Environment> Square for Field<E>
impl<E: Environment> Square for Field<E>
sourceimpl<E: Environment> SquareRoot for Field<E>
impl<E: Environment> SquareRoot for Field<E>
sourceimpl<E: Environment> Sub<&Field<E>> for Field<E>
impl<E: Environment> Sub<&Field<E>> for Field<E>
sourceimpl<E: Environment> Sub<Field<E>> for Field<E>
impl<E: Environment> Sub<Field<E>> for Field<E>
sourceimpl<E: Environment> SubAssign<&Field<E>> for Field<E>
impl<E: Environment> SubAssign<&Field<E>> for Field<E>
sourcefn sub_assign(&mut self, other: &Field<E>)
fn sub_assign(&mut self, other: &Field<E>)
Subtracts other
from self
.
sourceimpl<E: Environment> SubAssign<Field<E>> for Field<E>
impl<E: Environment> SubAssign<Field<E>> for Field<E>
sourcefn sub_assign(&mut self, other: Field<E>)
fn sub_assign(&mut self, other: Field<E>)
Subtracts other
from self
.
sourceimpl<'a, E: Environment> Sum<&'a Field<E>> for Field<E>
impl<'a, E: Environment> Sum<&'a Field<E>> for Field<E>
sourceimpl<E: Environment> Sum<Field<E>> for Field<E>
impl<E: Environment> Sum<Field<E>> for Field<E>
sourceimpl<E: Environment> Ternary for Field<E>
impl<E: Environment> Ternary for Field<E>
sourceimpl<E: Environment> ToBits for Field<E>
impl<E: Environment> ToBits for Field<E>
sourceimpl<E: Environment> ToBytes for Field<E>
impl<E: Environment> ToBytes for Field<E>
sourceimpl<E: Environment> TypeName for Field<E>
impl<E: Environment> TypeName for Field<E>
sourceimpl<E: Environment> Zero for Field<E>
impl<E: Environment> Zero for Field<E>
impl<E: Copy + Environment> Copy for Field<E> where
E::Field: Copy,
impl<E: Eq + Environment> Eq for Field<E> where
E::Field: Eq,
impl<E: Environment> FieldTrait for Field<E>
impl<E: Environment> StructuralEq for Field<E>
impl<E: Environment> StructuralPartialEq for Field<E>
Auto Trait Implementations
impl<E> RefUnwindSafe for Field<E> where
<E as Environment>::Field: RefUnwindSafe,
impl<E> Send for Field<E>
impl<E> Sync for Field<E>
impl<E> Unpin for Field<E> where
<E as Environment>::Field: Unpin,
impl<E> UnwindSafe for Field<E> where
<E as Environment>::Field: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more