Struct snarkvm_console_algorithms::Field
pub struct Field<E>where
E: Environment,{ /* private fields */ }
Implementations§
§impl<E> Field<E>where
E: Environment,
impl<E> Field<E>where E: Environment,
pub 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.
pub 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.
pub 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.
pub 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.
pub 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§
§impl<E> Add<&Field<E>> for Field<E>where
E: Environment,
impl<E> Add<&Field<E>> for Field<E>where E: Environment,
§impl<E> Add<Field<E>> for Field<E>where
E: Environment,
impl<E> Add<Field<E>> for Field<E>where E: Environment,
§impl<E> AddAssign<&Field<E>> for Field<E>where
E: Environment,
impl<E> AddAssign<&Field<E>> for Field<E>where E: Environment,
§fn add_assign(&mut self, other: &Field<E>)
fn add_assign(&mut self, other: &Field<E>)
Adds other
to self
.
§impl<E> AddAssign<Field<E>> for Field<E>where
E: Environment,
impl<E> AddAssign<Field<E>> for Field<E>where E: Environment,
§fn add_assign(&mut self, other: Field<E>)
fn add_assign(&mut self, other: Field<E>)
Adds other
to self
.
§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,
§impl<E> Compare<Field<E>> for Field<E>where
E: Environment,
impl<E> Compare<Field<E>> for Field<E>where E: Environment,
§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
.
§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
.
§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
.
§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>
§impl<E> Debug for Field<E>where
E: Environment,
impl<E> Debug for Field<E>where E: Environment,
§impl<E> Deref for Field<E>where
E: Environment,
impl<E> Deref for Field<E>where E: Environment,
§impl<E> DerefMut for Field<E>where
E: Environment,
impl<E> DerefMut for Field<E>where E: Environment,
§impl<'de, E> Deserialize<'de> for Field<E>where
E: Environment,
impl<'de, E> Deserialize<'de> for Field<E>where E: Environment,
§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.
§impl<E> Display for Field<E>where
E: Environment,
impl<E> Display for Field<E>where E: Environment,
§impl<E> Distribution<Field<E>> for Standardwhere
E: Environment,
impl<E> Distribution<Field<E>> for Standardwhere E: Environment,
§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.§impl<E> Div<&Field<E>> for Field<E>where
E: Environment,
impl<E> Div<&Field<E>> for Field<E>where E: Environment,
§impl<E> Div<Field<E>> for Field<E>where
E: Environment,
impl<E> Div<Field<E>> for Field<E>where E: Environment,
§impl<E> DivAssign<&Field<E>> for Field<E>where
E: Environment,
impl<E> DivAssign<&Field<E>> for Field<E>where E: Environment,
§fn div_assign(&mut self, other: &Field<E>)
fn div_assign(&mut self, other: &Field<E>)
Divides self
by other
.
§impl<E> DivAssign<Field<E>> for Field<E>where
E: Environment,
impl<E> DivAssign<Field<E>> for Field<E>where E: Environment,
§fn div_assign(&mut self, other: Field<E>)
fn div_assign(&mut self, other: Field<E>)
Divides self
by other
.
§impl<E> Double for Field<E>where
E: Environment,
impl<E> Double for Field<E>where E: Environment,
§impl<E> Equal<Field<E>> for Field<E>where
E: Environment,
impl<E> Equal<Field<E>> for Field<E>where E: Environment,
§impl<E> FromBits for Field<E>where
E: Environment,
impl<E> FromBits for Field<E>where E: Environment,
§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_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.
§impl<E> FromBytes for Field<E>where
E: Environment,
impl<E> FromBytes for Field<E>where E: Environment,
§impl<E> FromStr for Field<E>where
E: Environment,
impl<E> FromStr for Field<E>where E: Environment,
§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,
§impl<E> Inverse for Field<E>where
E: Environment,
impl<E> Inverse for Field<E>where E: Environment,
§impl<E> Mul<&Field<E>> for Field<E>where
E: Environment,
impl<E> Mul<&Field<E>> for Field<E>where E: Environment,
§impl<E> Mul<Field<E>> for Field<E>where
E: Environment,
impl<E> Mul<Field<E>> for Field<E>where E: Environment,
§impl<E> MulAssign<&Field<E>> for Field<E>where
E: Environment,
impl<E> MulAssign<&Field<E>> for Field<E>where E: Environment,
§fn mul_assign(&mut self, other: &Field<E>)
fn mul_assign(&mut self, other: &Field<E>)
Multiplies self
by other
.
§impl<E> MulAssign<Field<E>> for Field<E>where
E: Environment,
impl<E> MulAssign<Field<E>> for Field<E>where E: Environment,
§fn mul_assign(&mut self, other: Field<E>)
fn mul_assign(&mut self, other: Field<E>)
Multiplies self
by other
.
§impl<E> Neg for Field<E>where
E: Environment,
impl<E> Neg for Field<E>where E: Environment,
§impl<E> One for Field<E>where
E: Environment,
impl<E> One for Field<E>where E: Environment,
§impl<E> Ord for Field<E>where
E: Environment,
impl<E> Ord for Field<E>where E: Environment,
§impl<E> Parser for Field<E>where
E: Environment,
impl<E> Parser for Field<E>where E: Environment,
§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>,
§impl<E> PartialOrd<Field<E>> for Field<E>where
E: Environment,
impl<E> PartialOrd<Field<E>> for Field<E>where E: Environment,
§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 more§impl<E> Pow<&Field<E>> for Field<E>where
E: Environment,
impl<E> Pow<&Field<E>> for Field<E>where E: Environment,
§impl<E> Pow<Field<E>> for Field<E>where
E: Environment,
impl<E> Pow<Field<E>> for Field<E>where E: Environment,
§impl<'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,
§impl<E> Product<Field<E>> for Field<E>where
E: Environment,
impl<E> Product<Field<E>> for Field<E>where E: Environment,
§impl<E> Serialize for Field<E>where
E: Environment,
impl<E> Serialize for Field<E>where E: Environment,
§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.
§impl<E> SizeInBits for Field<E>where
E: Environment,
impl<E> SizeInBits for Field<E>where E: Environment,
§fn size_in_bits() -> usize
fn size_in_bits() -> usize
Returns the field size in bits.
§impl<E> SizeInBytes for Field<E>where
E: Environment,
impl<E> SizeInBytes for Field<E>where E: Environment,
§fn size_in_bytes() -> usize
fn size_in_bytes() -> usize
Returns the field size in bytes.
§impl<E> SizeInDataBits for Field<E>where
E: Environment,
impl<E> SizeInDataBits for Field<E>where E: Environment,
§fn size_in_data_bits() -> usize
fn size_in_data_bits() -> usize
Returns the field capacity for data bits.
§impl<E> Square for Field<E>where
E: Environment,
impl<E> Square for Field<E>where E: Environment,
§impl<E> SquareRoot for Field<E>where
E: Environment,
impl<E> SquareRoot for Field<E>where E: Environment,
§fn 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>
§impl<E> Sub<&Field<E>> for Field<E>where
E: Environment,
impl<E> Sub<&Field<E>> for Field<E>where E: Environment,
§impl<E> Sub<Field<E>> for Field<E>where
E: Environment,
impl<E> Sub<Field<E>> for Field<E>where E: Environment,
§impl<E> SubAssign<&Field<E>> for Field<E>where
E: Environment,
impl<E> SubAssign<&Field<E>> for Field<E>where E: Environment,
§fn sub_assign(&mut self, other: &Field<E>)
fn sub_assign(&mut self, other: &Field<E>)
Subtracts other
from self
.
§impl<E> SubAssign<Field<E>> for Field<E>where
E: Environment,
impl<E> SubAssign<Field<E>> for Field<E>where E: Environment,
§fn sub_assign(&mut self, other: Field<E>)
fn sub_assign(&mut self, other: Field<E>)
Subtracts other
from self
.
§impl<'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,
§impl<E> Sum<Field<E>> for Field<E>where
E: Environment,
impl<E> Sum<Field<E>> for Field<E>where E: Environment,
§impl<E> Ternary for Field<E>where
E: Environment,
impl<E> Ternary for Field<E>where E: Environment,
§impl<E> ToBits for Field<E>where
E: Environment,
impl<E> ToBits for Field<E>where E: Environment,
§fn 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.
§fn 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.
§impl<E> ToBytes for Field<E>where
E: Environment,
impl<E> ToBytes for Field<E>where E: Environment,
§impl<E> TypeName for Field<E>where
E: Environment,
impl<E> TypeName for Field<E>where E: Environment,
§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>,
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.