Struct snarkvm_console_types_group::Field
source · pub struct Field<E>where
E: Environment,{ /* private fields */ }
Implementations
sourceimpl<E> Field<E>where
E: Environment,
impl<E> Field<E>where
E: Environment,
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 = (<E::Field>::SIZE_IN_BITS + 7) / 8
pub const SIZE_IN_BYTES: usize = (<E::Field>::SIZE_IN_BITS + 7) / 8
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 const fn new(field: <E as Environment>::Field) -> Field<E>
pub const fn new(field: <E as Environment>::Field) -> Field<E>
Initializes a new field.
sourcepub fn new_domain_separator(domain: &str) -> Field<E>
pub fn new_domain_separator(domain: &str) -> Field<E>
Initializes a new field as a domain separator.
Trait Implementations
sourceimpl<E> Add<&Field<E>> for Field<E>where
E: Environment,
impl<E> Add<&Field<E>> for Field<E>where
E: Environment,
sourceimpl<E> Add<Field<E>> for Field<E>where
E: Environment,
impl<E> Add<Field<E>> for Field<E>where
E: Environment,
sourceimpl<E> AddAssign<&Field<E>> for Field<E>where
E: Environment,
impl<E> AddAssign<&Field<E>> for Field<E>where
E: Environment,
sourcefn add_assign(&mut self, other: &Field<E>)
fn add_assign(&mut self, other: &Field<E>)
Adds other
to self
.
sourceimpl<E> AddAssign<Field<E>> for Field<E>where
E: Environment,
impl<E> AddAssign<Field<E>> for Field<E>where
E: Environment,
sourcefn add_assign(&mut self, other: Field<E>)
fn add_assign(&mut self, other: Field<E>)
Adds other
to self
.
sourceimpl<E> Clone for Field<E>where
E: Clone + Environment,
<E as Environment>::Field: Clone,
impl<E> Clone for Field<E>where
E: Clone + Environment,
<E as Environment>::Field: Clone,
sourceimpl<E> Compare<Field<E>> for Field<E>where
E: Environment,
impl<E> Compare<Field<E>> for Field<E>where
E: Environment,
sourcefn is_less_than(
&self,
other: &Field<E>
) -> <Field<E> as Compare<Field<E>>>::Output
fn is_less_than(
&self,
other: &Field<E>
) -> <Field<E> as Compare<Field<E>>>::Output
Returns true
if self
is less than other
.
sourcefn is_greater_than(
&self,
other: &Field<E>
) -> <Field<E> as Compare<Field<E>>>::Output
fn is_greater_than(
&self,
other: &Field<E>
) -> <Field<E> as Compare<Field<E>>>::Output
Returns true
if self
is greater than other
.
sourcefn is_less_than_or_equal(
&self,
other: &Field<E>
) -> <Field<E> as Compare<Field<E>>>::Output
fn is_less_than_or_equal(
&self,
other: &Field<E>
) -> <Field<E> as Compare<Field<E>>>::Output
Returns true
if self
is less than or equal to other
.
sourcefn is_greater_than_or_equal(
&self,
other: &Field<E>
) -> <Field<E> as Compare<Field<E>>>::Output
fn is_greater_than_or_equal(
&self,
other: &Field<E>
) -> <Field<E> as Compare<Field<E>>>::Output
Returns true
if self
is greater than or equal to other
.
type Output = Boolean<E>
sourceimpl<E> Debug for Field<E>where
E: Environment,
impl<E> Debug for Field<E>where
E: Environment,
sourceimpl<E> Deref for Field<E>where
E: Environment,
impl<E> Deref for Field<E>where
E: Environment,
sourceimpl<E> DerefMut for Field<E>where
E: Environment,
impl<E> DerefMut for Field<E>where
E: Environment,
sourceimpl<'de, E> Deserialize<'de> for Field<E>where
E: Environment,
impl<'de, E> Deserialize<'de> for Field<E>where
E: Environment,
sourcefn deserialize<D>(
deserializer: D
) -> Result<Field<E>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Field<E>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserializes the field from a string or bytes.
sourceimpl<E> Display for Field<E>where
E: Environment,
impl<E> Display for Field<E>where
E: Environment,
sourceimpl<E> Distribution<Field<E>> for Standardwhere
E: Environment,
impl<E> Distribution<Field<E>> for Standardwhere
E: Environment,
sourcefn sample<R>(&self, rng: &mut R) -> Field<E>where
R: Rng + ?Sized,
fn sample<R>(&self, rng: &mut R) -> Field<E>where
R: Rng + ?Sized,
T
, using rng
as the source of randomness.sourceimpl<E> Div<&Field<E>> for Field<E>where
E: Environment,
impl<E> Div<&Field<E>> for Field<E>where
E: Environment,
sourceimpl<E> Div<Field<E>> for Field<E>where
E: Environment,
impl<E> Div<Field<E>> for Field<E>where
E: Environment,
sourceimpl<E> DivAssign<&Field<E>> for Field<E>where
E: Environment,
impl<E> DivAssign<&Field<E>> for Field<E>where
E: Environment,
sourcefn div_assign(&mut self, other: &Field<E>)
fn div_assign(&mut self, other: &Field<E>)
Divides self
by other
.
sourceimpl<E> DivAssign<Field<E>> for Field<E>where
E: Environment,
impl<E> DivAssign<Field<E>> for Field<E>where
E: Environment,
sourcefn div_assign(&mut self, other: Field<E>)
fn div_assign(&mut self, other: Field<E>)
Divides self
by other
.
sourceimpl<E> Double for Field<E>where
E: Environment,
impl<E> Double for Field<E>where
E: Environment,
sourceimpl<E> Equal<Field<E>> for Field<E>where
E: Environment,
impl<E> Equal<Field<E>> for Field<E>where
E: Environment,
sourceimpl<E> FromBits for Field<E>where
E: Environment,
impl<E> FromBits for Field<E>where
E: Environment,
sourcefn from_bits_le(bits_le: &[bool]) -> Result<Field<E>, Error>
fn from_bits_le(bits_le: &[bool]) -> Result<Field<E>, Error>
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.
sourceimpl<E> FromBytes for Field<E>where
E: Environment,
impl<E> FromBytes for Field<E>where
E: Environment,
sourceimpl<E> FromStr for Field<E>where
E: Environment,
impl<E> FromStr for Field<E>where
E: Environment,
sourceimpl<E> Hash for Field<E>where
E: Hash + Environment,
<E as Environment>::Field: Hash,
impl<E> Hash for Field<E>where
E: Hash + Environment,
<E as Environment>::Field: Hash,
sourceimpl<E> Inverse for Field<E>where
E: Environment,
impl<E> Inverse for Field<E>where
E: Environment,
sourceimpl<E> Mul<&Field<E>> for Field<E>where
E: Environment,
impl<E> Mul<&Field<E>> for Field<E>where
E: Environment,
sourceimpl<E> Mul<Field<E>> for Field<E>where
E: Environment,
impl<E> Mul<Field<E>> for Field<E>where
E: Environment,
sourceimpl<E> MulAssign<&Field<E>> for Field<E>where
E: Environment,
impl<E> MulAssign<&Field<E>> for Field<E>where
E: Environment,
sourcefn mul_assign(&mut self, other: &Field<E>)
fn mul_assign(&mut self, other: &Field<E>)
Multiplies self
by other
.
sourceimpl<E> MulAssign<Field<E>> for Field<E>where
E: Environment,
impl<E> MulAssign<Field<E>> for Field<E>where
E: Environment,
sourcefn mul_assign(&mut self, other: Field<E>)
fn mul_assign(&mut self, other: Field<E>)
Multiplies self
by other
.
sourceimpl<E> Neg for Field<E>where
E: Environment,
impl<E> Neg for Field<E>where
E: Environment,
sourceimpl<E> One for Field<E>where
E: Environment,
impl<E> One for Field<E>where
E: Environment,
sourceimpl<E> Ord for Field<E>where
E: Environment,
impl<E> Ord for Field<E>where
E: Environment,
sourcefn cmp(&self, other: &Field<E>) -> Ordering
fn cmp(&self, other: &Field<E>) -> Ordering
Returns the lexicographic ordering of self
and other
.
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
sourceimpl<E> Parser for Field<E>where
E: Environment,
impl<E> Parser for Field<E>where
E: Environment,
sourceimpl<E> PartialEq<Field<E>> for Field<E>where
E: PartialEq<E> + Environment,
<E as Environment>::Field: PartialEq<<E as Environment>::Field>,
impl<E> PartialEq<Field<E>> for Field<E>where
E: PartialEq<E> + Environment,
<E as Environment>::Field: PartialEq<<E as Environment>::Field>,
sourceimpl<E> PartialOrd<Field<E>> for Field<E>where
E: Environment,
impl<E> PartialOrd<Field<E>> for Field<E>where
E: Environment,
sourcefn partial_cmp(&self, other: &Field<E>) -> Option<Ordering>
fn partial_cmp(&self, other: &Field<E>) -> Option<Ordering>
Returns the lexicographic ordering of self
and other
.
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl<E> Pow<&Field<E>> for Field<E>where
E: Environment,
impl<E> Pow<&Field<E>> for Field<E>where
E: Environment,
sourceimpl<E> Pow<Field<E>> for Field<E>where
E: Environment,
impl<E> Pow<Field<E>> for Field<E>where
E: Environment,
sourceimpl<'a, E> Product<&'a Field<E>> for Field<E>where
E: Environment,
impl<'a, E> Product<&'a Field<E>> for Field<E>where
E: Environment,
sourceimpl<E> Product<Field<E>> for Field<E>where
E: Environment,
impl<E> Product<Field<E>> for Field<E>where
E: Environment,
sourceimpl<E> Serialize for Field<E>where
E: Environment,
impl<E> Serialize for Field<E>where
E: Environment,
sourcefn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serializes the field into a string or as bytes.
sourceimpl<E> SizeInBits for Field<E>where
E: Environment,
impl<E> SizeInBits for Field<E>where
E: Environment,
sourcefn size_in_bits() -> usize
fn size_in_bits() -> usize
Returns the field size in bits.
sourceimpl<E> SizeInBytes for Field<E>where
E: Environment,
impl<E> SizeInBytes for Field<E>where
E: Environment,
sourcefn size_in_bytes() -> usize
fn size_in_bytes() -> usize
Returns the field size in bytes.
sourceimpl<E> SizeInDataBits for Field<E>where
E: Environment,
impl<E> SizeInDataBits for Field<E>where
E: Environment,
sourcefn size_in_data_bits() -> usize
fn size_in_data_bits() -> usize
Returns the field capacity for data bits.
sourceimpl<E> Square for Field<E>where
E: Environment,
impl<E> Square for Field<E>where
E: Environment,
sourceimpl<E> SquareRoot for Field<E>where
E: Environment,
impl<E> SquareRoot for Field<E>where
E: Environment,
sourcefn square_root(&self) -> Result<<Field<E> as SquareRoot>::Output, Error>
fn square_root(&self) -> Result<<Field<E> as SquareRoot>::Output, Error>
Returns the square_root
of self
.
type Output = Field<E>
sourceimpl<E> Sub<&Field<E>> for Field<E>where
E: Environment,
impl<E> Sub<&Field<E>> for Field<E>where
E: Environment,
sourceimpl<E> Sub<Field<E>> for Field<E>where
E: Environment,
impl<E> Sub<Field<E>> for Field<E>where
E: Environment,
sourceimpl<E> SubAssign<&Field<E>> for Field<E>where
E: Environment,
impl<E> SubAssign<&Field<E>> for Field<E>where
E: Environment,
sourcefn sub_assign(&mut self, other: &Field<E>)
fn sub_assign(&mut self, other: &Field<E>)
Subtracts other
from self
.
sourceimpl<E> SubAssign<Field<E>> for Field<E>where
E: Environment,
impl<E> SubAssign<Field<E>> for Field<E>where
E: Environment,
sourcefn sub_assign(&mut self, other: Field<E>)
fn sub_assign(&mut self, other: Field<E>)
Subtracts other
from self
.
sourceimpl<'a, E> Sum<&'a Field<E>> for Field<E>where
E: Environment,
impl<'a, E> Sum<&'a Field<E>> for Field<E>where
E: Environment,
sourceimpl<E> Sum<Field<E>> for Field<E>where
E: Environment,
impl<E> Sum<Field<E>> for Field<E>where
E: Environment,
sourceimpl<E> Ternary for Field<E>where
E: Environment,
impl<E> Ternary for Field<E>where
E: Environment,
sourceimpl<E> ToBits for Field<E>where
E: Environment,
impl<E> ToBits for Field<E>where
E: Environment,
sourcefn to_bits_le(&self) -> Vec<bool, Global>ⓘ
fn to_bits_le(&self) -> Vec<bool, Global>ⓘ
Outputs the little-endian bit representation of self
without trailing zeros.
sourcefn to_bits_be(&self) -> Vec<bool, Global>ⓘ
fn to_bits_be(&self) -> Vec<bool, Global>ⓘ
Outputs the big-endian bit representation of self
without leading zeros.