Struct snarkvm_console_algorithms::scalar::Field  
source · pub struct Field<E>where
    E: Environment,{ /* private fields */ }Implementations§
source§impl<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§
source§impl<E> AddAssign<&Field<E>> for Field<E>where
    E: Environment,
 
impl<E> AddAssign<&Field<E>> for Field<E>where E: Environment,
source§fn add_assign(&mut self, other: &Field<E>)
 
fn add_assign(&mut self, other: &Field<E>)
Adds other to self.
source§impl<E> AddAssign<Field<E>> for Field<E>where
    E: Environment,
 
impl<E> AddAssign<Field<E>> for Field<E>where E: Environment,
source§fn add_assign(&mut self, other: Field<E>)
 
fn add_assign(&mut self, other: Field<E>)
Adds other to self.
source§impl<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,
source§impl<E> Compare<Field<E>> for Field<E>where
    E: Environment,
 
impl<E> Compare<Field<E>> for Field<E>where E: Environment,
source§fn 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.
source§fn 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.
source§fn 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.
source§fn 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>
source§impl<E> Debug for Field<E>where
    E: Environment,
 
impl<E> Debug for Field<E>where E: Environment,
source§impl<E> Deref for Field<E>where
    E: Environment,
 
impl<E> Deref for Field<E>where E: Environment,
source§impl<E> DerefMut for Field<E>where
    E: Environment,
 
impl<E> DerefMut for Field<E>where E: Environment,
source§impl<'de, E> Deserialize<'de> for Field<E>where
    E: Environment,
 
impl<'de, E> Deserialize<'de> for Field<E>where E: Environment,
source§fn 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.
source§impl<E> Display for Field<E>where
    E: Environment,
 
impl<E> Display for Field<E>where E: Environment,
source§impl<E> Distribution<Field<E>> for Standardwhere
    E: Environment,
 
impl<E> Distribution<Field<E>> for Standardwhere E: Environment,
source§fn 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.source§impl<E> DivAssign<&Field<E>> for Field<E>where
    E: Environment,
 
impl<E> DivAssign<&Field<E>> for Field<E>where E: Environment,
source§fn div_assign(&mut self, other: &Field<E>)
 
fn div_assign(&mut self, other: &Field<E>)
Divides self by other.
source§impl<E> DivAssign<Field<E>> for Field<E>where
    E: Environment,
 
impl<E> DivAssign<Field<E>> for Field<E>where E: Environment,
source§fn div_assign(&mut self, other: Field<E>)
 
fn div_assign(&mut self, other: Field<E>)
Divides self by other.
source§impl<E> Double for Field<E>where
    E: Environment,
 
impl<E> Double for Field<E>where E: Environment,
source§impl<E> FromBits for Field<E>where
    E: Environment,
 
impl<E> FromBits for Field<E>where E: Environment,
source§fn 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_leis longer thanE::Field::size_in_bits(), the excess bits are enforced to be0s.
- If bits_leis shorter thanE::Field::size_in_bits(), it is padded with0s up to field size.
source§impl<E> FromBytes for Field<E>where
    E: Environment,
 
impl<E> FromBytes for Field<E>where E: Environment,
source§impl<E> FromStr for Field<E>where
    E: Environment,
 
impl<E> FromStr for Field<E>where E: Environment,
source§impl<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,
source§impl<E> Inverse for Field<E>where
    E: Environment,
 
impl<E> Inverse for Field<E>where E: Environment,
source§impl<E> MulAssign<&Field<E>> for Field<E>where
    E: Environment,
 
impl<E> MulAssign<&Field<E>> for Field<E>where E: Environment,
source§fn mul_assign(&mut self, other: &Field<E>)
 
fn mul_assign(&mut self, other: &Field<E>)
Multiplies self by other.
source§impl<E> MulAssign<Field<E>> for Field<E>where
    E: Environment,
 
impl<E> MulAssign<Field<E>> for Field<E>where E: Environment,
source§fn mul_assign(&mut self, other: Field<E>)
 
fn mul_assign(&mut self, other: Field<E>)
Multiplies self by other.
source§impl<E> Neg for Field<E>where
    E: Environment,
 
impl<E> Neg for Field<E>where E: Environment,
source§impl<E> One for Field<E>where
    E: Environment,
 
impl<E> One for Field<E>where E: Environment,
source§impl<E> Ord for Field<E>where
    E: Environment,
 
impl<E> Ord for Field<E>where E: Environment,
source§fn cmp(&self, other: &Field<E>) -> Ordering
 
fn cmp(&self, other: &Field<E>) -> Ordering
Returns the lexicographic ordering of self and other.
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl<E> Parser for Field<E>where
    E: Environment,
 
impl<E> Parser for Field<E>where E: Environment,
source§impl<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>,
source§impl<E> PartialOrd<Field<E>> for Field<E>where
    E: Environment,
 
impl<E> PartialOrd<Field<E>> for Field<E>where E: Environment,
source§fn 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 · 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> Serialize for Field<E>where
    E: Environment,
 
impl<E> Serialize for Field<E>where E: Environment,
source§fn 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.
source§impl<E> SizeInBits for Field<E>where
    E: Environment,
 
impl<E> SizeInBits for Field<E>where E: Environment,
source§fn size_in_bits() -> usize
 
fn size_in_bits() -> usize
Returns the field size in bits.
source§impl<E> SizeInBytes for Field<E>where
    E: Environment,
 
impl<E> SizeInBytes for Field<E>where E: Environment,
source§fn size_in_bytes() -> usize
 
fn size_in_bytes() -> usize
Returns the field size in bytes.
source§impl<E> SizeInDataBits for Field<E>where
    E: Environment,
 
impl<E> SizeInDataBits for Field<E>where E: Environment,
source§fn size_in_data_bits() -> usize
 
fn size_in_data_bits() -> usize
Returns the field capacity for data bits.
source§impl<E> Square for Field<E>where
    E: Environment,
 
impl<E> Square for Field<E>where E: Environment,
source§impl<E> SquareRoot for Field<E>where
    E: Environment,
 
impl<E> SquareRoot for Field<E>where E: Environment,
source§impl<E> SubAssign<&Field<E>> for Field<E>where
    E: Environment,
 
impl<E> SubAssign<&Field<E>> for Field<E>where E: Environment,
source§fn sub_assign(&mut self, other: &Field<E>)
 
fn sub_assign(&mut self, other: &Field<E>)
Subtracts other from self.
source§impl<E> SubAssign<Field<E>> for Field<E>where
    E: Environment,
 
impl<E> SubAssign<Field<E>> for Field<E>where E: Environment,
source§fn sub_assign(&mut self, other: Field<E>)
 
fn sub_assign(&mut self, other: Field<E>)
Subtracts other from self.
source§impl<E> Ternary for Field<E>where
    E: Environment,
 
impl<E> Ternary for Field<E>where E: Environment,
source§impl<E> ToBits for Field<E>where
    E: Environment,
 
impl<E> ToBits for Field<E>where E: Environment,
source§impl<E> ToBytes for Field<E>where
    E: Environment,
 
impl<E> ToBytes for Field<E>where E: Environment,
source§impl<E> TypeName for Field<E>where
    E: Environment,
 
impl<E> TypeName for Field<E>where E: Environment,
source§impl<E> Zero for Field<E>where
    E: Environment,
 
impl<E> Zero for Field<E>where E: Environment,
impl<E> Copy for Field<E>where E: Copy + Environment, <E as Environment>::Field: Copy,
impl<E> Eq for Field<E>where E: Eq + Environment, <E as Environment>::Field: Eq,
impl<E> FieldTrait for Field<E>where E: Environment,
impl<E> StructuralEq for Field<E>where E: Environment,
impl<E> StructuralPartialEq for Field<E>where E: Environment,
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§
source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
source§impl<'de, T> DeserializeExt<'de> for Twhere
    T: DeserializeOwned,
 
impl<'de, T> DeserializeExt<'de> for Twhere T: DeserializeOwned,
fn take_from_value<D>( value: &mut Value, field: &str ) -> Result<T, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
source§impl<Q, K> Equivalent<K> for Qwhere
    Q: Eq + ?Sized,
    K: Borrow<Q> + ?Sized,
 
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.