Struct snarkvm_console_types_group::Scalar
source · [−]pub struct Scalar<E> where
E: Environment, { /* private fields */ }
Implementations
sourceimpl<E> Scalar<E> where
E: Environment,
impl<E> Scalar<E> where
E: Environment,
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 = (<E::Scalar>::SIZE_IN_BITS + 7) / 8
pub const SIZE_IN_BYTES: usize = (<E::Scalar>::SIZE_IN_BITS + 7) / 8
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.
sourcepub const fn new(scalar: <E as Environment>::Scalar) -> Scalar<E>
pub const fn new(scalar: <E as Environment>::Scalar) -> Scalar<E>
Initializes a new scalar.
Trait Implementations
sourceimpl<E> Add<&Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> Add<&Scalar<E>> for Scalar<E> where
E: Environment,
sourceimpl<E> Add<Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> Add<Scalar<E>> for Scalar<E> where
E: Environment,
sourceimpl<E> AddAssign<&Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> AddAssign<&Scalar<E>> for Scalar<E> where
E: Environment,
sourcefn add_assign(&mut self, other: &Scalar<E>)
fn add_assign(&mut self, other: &Scalar<E>)
Adds other
to self
.
sourceimpl<E> AddAssign<Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> AddAssign<Scalar<E>> for Scalar<E> where
E: Environment,
sourcefn add_assign(&mut self, other: Scalar<E>)
fn add_assign(&mut self, other: Scalar<E>)
Adds other
to self
.
sourceimpl<E> Clone for Scalar<E> where
E: Clone + Environment,
<E as Environment>::Scalar: Clone,
impl<E> Clone for Scalar<E> where
E: Clone + Environment,
<E as Environment>::Scalar: Clone,
sourceimpl<E> Compare<Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> Compare<Scalar<E>> for Scalar<E> where
E: Environment,
sourcefn is_less_than(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
fn is_less_than(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
Returns true
if self
is less than other
.
sourcefn is_greater_than(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
fn is_greater_than(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
Returns true
if self
is greater than other
.
sourcefn is_less_than_or_equal(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
fn is_less_than_or_equal(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
Returns true
if self
is less than or equal to other
.
sourcefn is_greater_than_or_equal(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
fn is_greater_than_or_equal(
&self,
other: &Scalar<E>
) -> <Scalar<E> as Compare<Scalar<E>>>::Output
Returns true
if self
is greater than or equal to other
.
type Output = Boolean<E>
sourceimpl<E> Debug for Scalar<E> where
E: Environment,
impl<E> Debug for Scalar<E> where
E: Environment,
sourceimpl<E> Deref for Scalar<E> where
E: Environment,
impl<E> Deref for Scalar<E> where
E: Environment,
sourceimpl<'de, E> Deserialize<'de> for Scalar<E> where
E: Environment,
impl<'de, E> Deserialize<'de> for Scalar<E> where
E: Environment,
sourcefn deserialize<D>(
deserializer: D
) -> Result<Scalar<E>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Scalar<E>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserializes the scalar from a string or bytes.
sourceimpl<E> Display for Scalar<E> where
E: Environment,
impl<E> Display for Scalar<E> where
E: Environment,
sourceimpl<E> Distribution<Scalar<E>> for Standard where
E: Environment,
impl<E> Distribution<Scalar<E>> for Standard where
E: Environment,
sourcefn sample<R>(&self, rng: &mut R) -> Scalar<E> where
R: Rng + ?Sized,
fn sample<R>(&self, rng: &mut R) -> Scalar<E> where
R: Rng + ?Sized,
Generate a random value of T
, using rng
as the source of randomness.
sourcefn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
sourceimpl<E> Div<&Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> Div<&Scalar<E>> for Scalar<E> where
E: Environment,
sourceimpl<E> Div<Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> Div<Scalar<E>> for Scalar<E> where
E: Environment,
sourceimpl<E> DivAssign<&Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> DivAssign<&Scalar<E>> for Scalar<E> where
E: Environment,
sourcefn div_assign(&mut self, other: &Scalar<E>)
fn div_assign(&mut self, other: &Scalar<E>)
Divides self
by other
.
sourceimpl<E> DivAssign<Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> DivAssign<Scalar<E>> for Scalar<E> where
E: Environment,
sourcefn div_assign(&mut self, other: Scalar<E>)
fn div_assign(&mut self, other: Scalar<E>)
Divides self
by other
.
sourceimpl<E> Double for Scalar<E> where
E: Environment,
impl<E> Double for Scalar<E> where
E: Environment,
sourceimpl<E> Equal<Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> Equal<Scalar<E>> for Scalar<E> where
E: Environment,
sourceimpl<E> FromBits for Scalar<E> where
E: Environment,
impl<E> FromBits for Scalar<E> where
E: Environment,
sourcefn from_bits_le(bits_le: &[bool]) -> Result<Scalar<E>, Error>
fn from_bits_le(bits_le: &[bool]) -> Result<Scalar<E>, Error>
Initializes a new scalar from a list of little-endian bits.
- If
bits_le
is longer thanE::Scalar::size_in_bits()
, the excess bits are enforced to be0
s. - If
bits_le
is shorter thanE::Scalar::size_in_bits()
, it is padded with0
s up to scalar size.
sourceimpl<E> FromBytes for Scalar<E> where
E: Environment,
impl<E> FromBytes for Scalar<E> where
E: Environment,
sourceimpl<E> FromStr for Scalar<E> where
E: Environment,
impl<E> FromStr for Scalar<E> where
E: Environment,
sourceimpl<E> Hash for Scalar<E> where
E: Hash + Environment,
<E as Environment>::Scalar: Hash,
impl<E> Hash for Scalar<E> where
E: Hash + Environment,
<E as Environment>::Scalar: Hash,
sourceimpl<E> Inverse for Scalar<E> where
E: Environment,
impl<E> Inverse for Scalar<E> where
E: Environment,
sourceimpl<E: Environment> Mul<&Group<E>> for Scalar<E>
impl<E: Environment> Mul<&Group<E>> for Scalar<E>
sourceimpl<E: Environment> Mul<&Scalar<E>> for Group<E>
impl<E: Environment> Mul<&Scalar<E>> for Group<E>
sourceimpl<E> Mul<&Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> Mul<&Scalar<E>> for Scalar<E> where
E: Environment,
sourceimpl<E: Environment> Mul<Group<E>> for Scalar<E>
impl<E: Environment> Mul<Group<E>> for Scalar<E>
sourceimpl<E: Environment> Mul<Scalar<E>> for Group<E>
impl<E: Environment> Mul<Scalar<E>> for Group<E>
sourceimpl<E> Mul<Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> Mul<Scalar<E>> for Scalar<E> where
E: Environment,
sourceimpl<E: Environment> MulAssign<&Scalar<E>> for Group<E>
impl<E: Environment> MulAssign<&Scalar<E>> for Group<E>
sourcefn mul_assign(&mut self, other: &Scalar<E>)
fn mul_assign(&mut self, other: &Scalar<E>)
Multiplies self
by other
.
sourceimpl<E> MulAssign<&Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> MulAssign<&Scalar<E>> for Scalar<E> where
E: Environment,
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 Group<E>
impl<E: Environment> MulAssign<Scalar<E>> for Group<E>
sourcefn mul_assign(&mut self, other: Scalar<E>)
fn mul_assign(&mut self, other: Scalar<E>)
Multiplies self
by other
.
sourceimpl<E> MulAssign<Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> MulAssign<Scalar<E>> for Scalar<E> where
E: Environment,
sourcefn mul_assign(&mut self, other: Scalar<E>)
fn mul_assign(&mut self, other: Scalar<E>)
Multiplies self
by other
.
sourceimpl<E> Neg for Scalar<E> where
E: Environment,
impl<E> Neg for Scalar<E> where
E: Environment,
sourceimpl<E> One for Scalar<E> where
E: Environment,
impl<E> One for Scalar<E> where
E: Environment,
sourceimpl<E> Ord for Scalar<E> where
E: Environment,
impl<E> Ord for Scalar<E> where
E: Environment,
sourcefn cmp(&self, other: &Scalar<E>) -> Ordering
fn cmp(&self, other: &Scalar<E>) -> Ordering
Returns the lexicographic ordering of self
and other
.
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<E> Parser for Scalar<E> where
E: Environment,
impl<E> Parser for Scalar<E> where
E: Environment,
sourceimpl<E> PartialEq<Scalar<E>> for Scalar<E> where
E: PartialEq<E> + Environment,
<E as Environment>::Scalar: PartialEq<<E as Environment>::Scalar>,
impl<E> PartialEq<Scalar<E>> for Scalar<E> where
E: PartialEq<E> + Environment,
<E as Environment>::Scalar: PartialEq<<E as Environment>::Scalar>,
sourceimpl<E> PartialOrd<Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> PartialOrd<Scalar<E>> for Scalar<E> where
E: Environment,
sourcefn partial_cmp(&self, other: &Scalar<E>) -> Option<Ordering>
fn partial_cmp(&self, other: &Scalar<E>) -> Option<Ordering>
Returns the lexicographic ordering of self
and other
.
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<E> Pow<&Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> Pow<&Scalar<E>> for Scalar<E> where
E: Environment,
sourceimpl<E> Pow<Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> Pow<Scalar<E>> for Scalar<E> where
E: Environment,
sourceimpl<'a, E> Product<&'a Scalar<E>> for Scalar<E> where
E: Environment,
impl<'a, E> Product<&'a Scalar<E>> for Scalar<E> where
E: Environment,
sourceimpl<E> Product<Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> Product<Scalar<E>> for Scalar<E> where
E: Environment,
sourceimpl<E> Serialize for Scalar<E> where
E: Environment,
impl<E> Serialize for Scalar<E> where
E: Environment,
sourcefn 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 scalar into a string or as bytes.
sourceimpl<E> SizeInBits for Scalar<E> where
E: Environment,
impl<E> SizeInBits for Scalar<E> where
E: Environment,
sourcefn size_in_bits() -> usize
fn size_in_bits() -> usize
Returns the scalar size in bits.
sourceimpl<E> SizeInBytes for Scalar<E> where
E: Environment,
impl<E> SizeInBytes for Scalar<E> where
E: Environment,
sourcefn size_in_bytes() -> usize
fn size_in_bytes() -> usize
Returns the scalar size in bytes.
sourceimpl<E> SizeInDataBits for Scalar<E> where
E: Environment,
impl<E> SizeInDataBits for Scalar<E> where
E: Environment,
sourcefn size_in_data_bits() -> usize
fn size_in_data_bits() -> usize
Returns the scalar capacity for data bits.
sourceimpl<E> Square for Scalar<E> where
E: Environment,
impl<E> Square for Scalar<E> where
E: Environment,
sourceimpl<E> Sub<&Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> Sub<&Scalar<E>> for Scalar<E> where
E: Environment,
sourceimpl<E> Sub<Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> Sub<Scalar<E>> for Scalar<E> where
E: Environment,
sourceimpl<E> SubAssign<&Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> SubAssign<&Scalar<E>> for Scalar<E> where
E: Environment,
sourcefn sub_assign(&mut self, other: &Scalar<E>)
fn sub_assign(&mut self, other: &Scalar<E>)
Subtracts other
from self
.
sourceimpl<E> SubAssign<Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> SubAssign<Scalar<E>> for Scalar<E> where
E: Environment,
sourcefn sub_assign(&mut self, other: Scalar<E>)
fn sub_assign(&mut self, other: Scalar<E>)
Subtracts other
from self
.
sourceimpl<'a, E> Sum<&'a Scalar<E>> for Scalar<E> where
E: Environment,
impl<'a, E> Sum<&'a Scalar<E>> for Scalar<E> where
E: Environment,
sourceimpl<E> Sum<Scalar<E>> for Scalar<E> where
E: Environment,
impl<E> Sum<Scalar<E>> for Scalar<E> where
E: Environment,
sourceimpl<E> Ternary for Scalar<E> where
E: Environment,
impl<E> Ternary for Scalar<E> where
E: Environment,
sourceimpl<E> ToBits for Scalar<E> where
E: Environment,
impl<E> ToBits for Scalar<E> where
E: Environment,
sourceimpl<E> ToBytes for Scalar<E> where
E: Environment,
impl<E> ToBytes for Scalar<E> where
E: Environment,
sourceimpl<E> ToField for Scalar<E> where
E: Environment,
impl<E> ToField for Scalar<E> where
E: Environment,
sourceimpl<E> TypeName for Scalar<E> where
E: Environment,
impl<E> TypeName for Scalar<E> where
E: Environment,
sourceimpl<E> Zero for Scalar<E> where
E: Environment,
impl<E> Zero for Scalar<E> where
E: Environment,
impl<E> Copy for Scalar<E> where
E: Copy + Environment,
<E as Environment>::Scalar: Copy,
impl<E> Eq for Scalar<E> where
E: Eq + Environment,
<E as Environment>::Scalar: Eq,
impl<E: Environment> GroupTrait<Scalar<E>> for Group<E>
impl<E> ScalarTrait for Scalar<E> where
E: Environment,
impl<E> StructuralEq for Scalar<E> where
E: Environment,
impl<E> StructuralPartialEq for Scalar<E> where
E: Environment,
Auto Trait Implementations
impl<E> RefUnwindSafe for Scalar<E> where
<E as Environment>::Scalar: RefUnwindSafe,
impl<E> Send for Scalar<E>
impl<E> Sync for Scalar<E>
impl<E> Unpin for Scalar<E> where
<E as Environment>::Scalar: Unpin,
impl<E> UnwindSafe for Scalar<E> where
<E as Environment>::Scalar: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more