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 fn even_square_root(&self) -> Result<Field<E>, Error>
pub fn even_square_root(&self) -> Result<Field<E>, Error>
Returns the square_root of self, where the least significant bit of the square root is zero.
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
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 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> Add for Field<E>where
E: Environment,
impl<E> Add for Field<E>where
E: Environment,
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 for Field<E>where
E: Environment,
impl<E> AddAssign 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> Compare for Field<E>where
E: Environment,
impl<E> Compare for Field<E>where
E: Environment,
Source§fn is_less_than(&self, other: &Field<E>) -> <Field<E> as Compare>::Output
fn is_less_than(&self, other: &Field<E>) -> <Field<E> as Compare>::Output
Returns true if self is less than other.
Source§fn is_greater_than(&self, other: &Field<E>) -> <Field<E> as Compare>::Output
fn is_greater_than(&self, other: &Field<E>) -> <Field<E> as Compare>::Output
Returns true if self is greater than other.
Source§fn is_less_than_or_equal(
&self,
other: &Field<E>,
) -> <Field<E> as Compare>::Output
fn is_less_than_or_equal( &self, other: &Field<E>, ) -> <Field<E> as Compare>::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>::Output
fn is_greater_than_or_equal( &self, other: &Field<E>, ) -> <Field<E> as Compare>::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> Default for Field<E>where
E: Environment,
impl<E> Default 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§impl<E> Div for Field<E>where
E: Environment,
impl<E> Div for Field<E>where
E: Environment,
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 for Field<E>where
E: Environment,
impl<E> DivAssign 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> Equal for Field<E>where
E: Environment,
impl<E> Equal 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§fn read_le<R>(reader: R) -> Result<Field<E>, Error>where
R: Read,
fn read_le<R>(reader: R) -> Result<Field<E>, Error>where
R: Read,
Reads the field from a buffer.
Source§fn from_bytes_le(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
fn from_bytes_le(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
Self from a byte array in little-endian order.Source§fn from_bytes_le_unchecked(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
fn from_bytes_le_unchecked(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
Self::from_bytes_le but avoids costly checks.
This shall only be called when deserializing from a trusted source, such as local storage. Read moreSource§fn read_le_unchecked<R>(reader: R) -> Result<Self, Error>
fn read_le_unchecked<R>(reader: R) -> Result<Self, Error>
Self::read_le but avoids costly checks.
This shall only be called when deserializing from a trusted source, such as local storage. Read moreSource§impl<E> FromStr for Field<E>where
E: Environment,
impl<E> FromStr for Field<E>where
E: Environment,
Source§impl<E> Inverse for Field<E>where
E: Environment,
impl<E> Inverse for Field<E>where
E: Environment,
Source§impl<E> Mul for Field<E>where
E: Environment,
impl<E> Mul 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 for Field<E>where
E: Environment,
impl<E> MulAssign 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> PartialOrd for Field<E>where
E: Environment,
impl<E> PartialOrd for Field<E>where
E: Environment,
Source§impl<E> Product for Field<E>where
E: Environment,
impl<E> Product for Field<E>where
E: Environment,
Source§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> Sub for Field<E>where
E: Environment,
impl<E> Sub 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 for Field<E>where
E: Environment,
impl<E> SubAssign 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> Sum for Field<E>where
E: Environment,
impl<E> Sum for Field<E>where
E: Environment,
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§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
Outputs the little-endian bit representation of self without trailing zeros.
Source§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
Outputs the big-endian bit representation of self without leading zeros.
Source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
self as a boolean array in little-endian order.Source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
self as a boolean array in big-endian order.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,
Source§impl<E> Zeroize for Field<E>where
E: Environment,
impl<E> Zeroize for Field<E>where
E: Environment,
impl<E> Copy for Field<E>
impl<E> Eq for Field<E>
impl<E> FieldTrait for Field<E>where
E: Environment,
impl<E> StructuralPartialEq for Field<E>where
E: Environment,
Auto Trait Implementations§
impl<E> Freeze for Field<E>
impl<E> RefUnwindSafe for Field<E>
impl<E> Send for Field<E>
impl<E> Sync for Field<E>
impl<E> Unpin for Field<E>
impl<E> UnwindSafe for Field<E>
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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 Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more