Struct snarkvm_console_types_scalar::Scalar
source · pub struct Scalar<E: Environment> { /* private fields */ }Implementations
sourceimpl<E: Environment> Scalar<E>
impl<E: Environment> Scalar<E>
sourcepub const SIZE_IN_BITS: usize = <E::Scalar>::SIZE_IN_BITS
pub const SIZE_IN_BITS: usize = <E::Scalar>::SIZE_IN_BITS
The scalar size in bits.
sourcepub const SIZE_IN_BYTES: usize = _
pub const SIZE_IN_BYTES: usize = _
The scalar size in bytes.
sourcepub const SIZE_IN_DATA_BITS: usize = <E::Scalar>::SIZE_IN_DATA_BITS
pub const SIZE_IN_DATA_BITS: usize = <E::Scalar>::SIZE_IN_DATA_BITS
The scalar capacity for data bits.
Trait Implementations
sourceimpl<E: Environment> Add<&Scalar<E>> for Scalar<E>
impl<E: Environment> Add<&Scalar<E>> for Scalar<E>
sourceimpl<E: Environment> Add<Scalar<E>> for Scalar<E>
impl<E: Environment> Add<Scalar<E>> for Scalar<E>
sourceimpl<E: Environment> AddAssign<&Scalar<E>> for Scalar<E>
impl<E: Environment> AddAssign<&Scalar<E>> for Scalar<E>
sourcefn add_assign(&mut self, other: &Scalar<E>)
fn add_assign(&mut self, other: &Scalar<E>)
Adds other to self.
sourceimpl<E: Environment> AddAssign<Scalar<E>> for Scalar<E>
impl<E: Environment> AddAssign<Scalar<E>> for Scalar<E>
sourcefn add_assign(&mut self, other: Scalar<E>)
fn add_assign(&mut self, other: Scalar<E>)
Adds other to self.
sourceimpl<E: Environment> Compare<Scalar<E>> for Scalar<E>
impl<E: Environment> Compare<Scalar<E>> for Scalar<E>
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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>
sourceimpl<E: Environment> Debug for Scalar<E>
impl<E: Environment> Debug for Scalar<E>
sourceimpl<E: Environment> Deref for Scalar<E>
impl<E: Environment> Deref for Scalar<E>
sourceimpl<'de, E: Environment> Deserialize<'de> for Scalar<E>
impl<'de, E: Environment> Deserialize<'de> for Scalar<E>
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserializes the scalar from a string or bytes.
sourceimpl<E: Environment> Display for Scalar<E>
impl<E: Environment> Display for Scalar<E>
sourceimpl<E: Environment> Distribution<Scalar<E>> for Standard
impl<E: Environment> Distribution<Scalar<E>> for Standard
sourcefn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Scalar<E>
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Scalar<E>
T, using rng as the source of randomness.sourceimpl<E: Environment> Div<&Scalar<E>> for Scalar<E>
impl<E: Environment> Div<&Scalar<E>> for Scalar<E>
sourceimpl<E: Environment> Div<Scalar<E>> for Scalar<E>
impl<E: Environment> Div<Scalar<E>> for Scalar<E>
sourceimpl<E: Environment> DivAssign<&Scalar<E>> for Scalar<E>
impl<E: Environment> DivAssign<&Scalar<E>> for Scalar<E>
sourcefn div_assign(&mut self, other: &Scalar<E>)
fn div_assign(&mut self, other: &Scalar<E>)
Divides self by other.
sourceimpl<E: Environment> DivAssign<Scalar<E>> for Scalar<E>
impl<E: Environment> DivAssign<Scalar<E>> for Scalar<E>
sourcefn div_assign(&mut self, other: Scalar<E>)
fn div_assign(&mut self, other: Scalar<E>)
Divides self by other.
sourceimpl<E: Environment> Double for Scalar<E>
impl<E: Environment> Double for Scalar<E>
sourceimpl<E: Environment> Equal<Scalar<E>> for Scalar<E>
impl<E: Environment> Equal<Scalar<E>> for Scalar<E>
sourceimpl<E: Environment> FromBits for Scalar<E>
impl<E: Environment> FromBits for Scalar<E>
sourcefn from_bits_le(bits_le: &[bool]) -> Result<Self>
fn from_bits_le(bits_le: &[bool]) -> Result<Self>
Initializes a new scalar from a list of little-endian bits.
- If
bits_leis longer thanE::Scalar::size_in_bits(), the excess bits are enforced to be0s. - If
bits_leis shorter thanE::Scalar::size_in_bits(), it is padded with0s up to scalar size.
sourcefn from_bits_be(bits_be: &[bool]) -> Result<Self>
fn from_bits_be(bits_be: &[bool]) -> Result<Self>
Initializes a new scalar from a list of big-endian bits without leading zeros.
sourceimpl<E: Environment> FromBytes for Scalar<E>
impl<E: Environment> FromBytes for Scalar<E>
sourceimpl<E: Environment> FromStr for Scalar<E>
impl<E: Environment> FromStr for Scalar<E>
sourceimpl<E: Environment> Inverse for Scalar<E>
impl<E: Environment> Inverse for Scalar<E>
sourceimpl<E: Environment> Mul<&Scalar<E>> for Scalar<E>
impl<E: Environment> Mul<&Scalar<E>> for Scalar<E>
sourceimpl<E: Environment> Mul<Scalar<E>> for Scalar<E>
impl<E: Environment> Mul<Scalar<E>> for Scalar<E>
sourceimpl<E: Environment> MulAssign<&Scalar<E>> for Scalar<E>
impl<E: Environment> MulAssign<&Scalar<E>> for Scalar<E>
sourcefn mul_assign(&mut self, other: &Scalar<E>)
fn mul_assign(&mut self, other: &Scalar<E>)
Multiplies self by other.
sourceimpl<E: Environment> MulAssign<Scalar<E>> for Scalar<E>
impl<E: Environment> MulAssign<Scalar<E>> for Scalar<E>
sourcefn mul_assign(&mut self, other: Scalar<E>)
fn mul_assign(&mut self, other: Scalar<E>)
Multiplies self by other.
sourceimpl<E: Environment> Neg for Scalar<E>
impl<E: Environment> Neg for Scalar<E>
sourceimpl<E: Environment> One for Scalar<E>
impl<E: Environment> One for Scalar<E>
sourceimpl<E: Environment> Ord for Scalar<E>
impl<E: Environment> Ord for Scalar<E>
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: Environment> Parser for Scalar<E>
impl<E: Environment> Parser for Scalar<E>
sourcefn parse(string: &str) -> ParserResult<'_, Self>
fn parse(string: &str) -> ParserResult<'_, Self>
Parses a string into a scalar circuit.
sourceimpl<E: PartialEq + Environment> PartialEq<Scalar<E>> for Scalar<E>where
E::Scalar: PartialEq,
impl<E: PartialEq + Environment> PartialEq<Scalar<E>> for Scalar<E>where
E::Scalar: PartialEq,
sourceimpl<E: Environment> PartialOrd<Scalar<E>> for Scalar<E>
impl<E: Environment> PartialOrd<Scalar<E>> for Scalar<E>
sourcefn 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 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresourceimpl<E: Environment> Pow<&Scalar<E>> for Scalar<E>
impl<E: Environment> Pow<&Scalar<E>> for Scalar<E>
sourceimpl<E: Environment> Pow<Scalar<E>> for Scalar<E>
impl<E: Environment> Pow<Scalar<E>> for Scalar<E>
sourceimpl<'a, E: Environment> Product<&'a Scalar<E>> for Scalar<E>
impl<'a, E: Environment> Product<&'a Scalar<E>> for Scalar<E>
sourceimpl<E: Environment> Product<Scalar<E>> for Scalar<E>
impl<E: Environment> Product<Scalar<E>> for Scalar<E>
sourceimpl<E: Environment> Serialize for Scalar<E>
impl<E: Environment> Serialize for Scalar<E>
sourceimpl<E: Environment> SizeInBits for Scalar<E>
impl<E: Environment> SizeInBits for Scalar<E>
sourcefn size_in_bits() -> usize
fn size_in_bits() -> usize
Returns the scalar size in bits.
sourceimpl<E: Environment> SizeInBytes for Scalar<E>
impl<E: Environment> SizeInBytes for Scalar<E>
sourcefn size_in_bytes() -> usize
fn size_in_bytes() -> usize
Returns the scalar size in bytes.
sourceimpl<E: Environment> SizeInDataBits for Scalar<E>
impl<E: Environment> SizeInDataBits for Scalar<E>
sourcefn size_in_data_bits() -> usize
fn size_in_data_bits() -> usize
Returns the scalar capacity for data bits.
sourceimpl<E: Environment> Square for Scalar<E>
impl<E: Environment> Square for Scalar<E>
sourceimpl<E: Environment> Sub<&Scalar<E>> for Scalar<E>
impl<E: Environment> Sub<&Scalar<E>> for Scalar<E>
sourceimpl<E: Environment> Sub<Scalar<E>> for Scalar<E>
impl<E: Environment> Sub<Scalar<E>> for Scalar<E>
sourceimpl<E: Environment> SubAssign<&Scalar<E>> for Scalar<E>
impl<E: Environment> SubAssign<&Scalar<E>> for Scalar<E>
sourcefn sub_assign(&mut self, other: &Scalar<E>)
fn sub_assign(&mut self, other: &Scalar<E>)
Subtracts other from self.
sourceimpl<E: Environment> SubAssign<Scalar<E>> for Scalar<E>
impl<E: Environment> SubAssign<Scalar<E>> for Scalar<E>
sourcefn sub_assign(&mut self, other: Scalar<E>)
fn sub_assign(&mut self, other: Scalar<E>)
Subtracts other from self.
sourceimpl<'a, E: Environment> Sum<&'a Scalar<E>> for Scalar<E>
impl<'a, E: Environment> Sum<&'a Scalar<E>> for Scalar<E>
sourceimpl<E: Environment> Sum<Scalar<E>> for Scalar<E>
impl<E: Environment> Sum<Scalar<E>> for Scalar<E>
sourceimpl<E: Environment> Ternary for Scalar<E>
impl<E: Environment> Ternary for Scalar<E>
sourceimpl<E: Environment> ToBits for Scalar<E>
impl<E: Environment> ToBits for Scalar<E>
sourcefn to_bits_le(&self) -> Vec<bool>ⓘ
fn to_bits_le(&self) -> Vec<bool>ⓘ
Outputs the little-endian bit representation of self without trailing zeros.
sourcefn to_bits_be(&self) -> Vec<bool>ⓘ
fn to_bits_be(&self) -> Vec<bool>ⓘ
Outputs the big-endian bit representation of self without leading zeros.