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.
source§impl<E: Environment> ToBytes for Field<E>
impl<E: Environment> ToBytes for Field<E>
source§impl<E: Environment> TypeName for Field<E>
impl<E: Environment> TypeName for Field<E>
source§impl<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§
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
§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.