pub struct Integer<E, I>where
    E: Environment,
    I: IntegerType,{ /* private fields */ }

Implementations§

§

impl<E, I> Integer<E, I>where E: Environment, I: IntegerType,

pub fn from_field_lossy(field: &Field<E>) -> Integer<E, I>

Casts an integer from a base field, with lossy truncation.

This method is commonly-used by hash-to-integer algorithms, where the hash output does not need to preserve the full base field.

§

impl<E, I> Integer<E, I>where E: Environment, I: IntegerType,

pub fn to_scalar(&self) -> Scalar<E>

Converts an integer into a scalar.

§

impl<E, I> Integer<E, I>where E: Environment, I: IntegerType,

pub const MAX: Integer<E, I> = _

pub const MIN: Integer<E, I> = _

pub const fn new(integer: I) -> Integer<E, I>

Initializes a new integer.

Trait Implementations§

§

impl<E, I> AbsChecked for Integer<E, I>where E: Environment, I: IntegerType,

§

fn abs_checked(self) -> <Integer<E, I> as AbsChecked>::Output

Returns the absolute value of self.

§

type Output = Integer<E, I>

§

impl<E, I> AbsWrapped for Integer<E, I>where E: Environment, I: IntegerType,

§

fn abs_wrapped(self) -> <Integer<E, I> as AbsWrapped>::Output

Returns the absolute value of self.

§

type Output = Integer<E, I>

§

impl<E, I> Add<&Integer<E, I>> for Integer<E, I>where E: Environment, I: IntegerType,

§

fn add( self, other: &Integer<E, I> ) -> <Integer<E, I> as Add<&Integer<E, I>>>::Output

Returns the sum of self and other.

§

type Output = Integer<E, I>

The resulting type after applying the + operator.
§

impl<E, I> Add for Integer<E, I>where E: Environment, I: IntegerType,

§

fn add(self, other: Integer<E, I>) -> <Integer<E, I> as Add>::Output

Returns the sum of self and other.

§

type Output = Integer<E, I>

The resulting type after applying the + operator.
§

impl<E, I> AddAssign<&Integer<E, I>> for Integer<E, I>where E: Environment, I: IntegerType,

§

fn add_assign(&mut self, other: &Integer<E, I>)

Adds other to self.

§

impl<E, I> AddAssign for Integer<E, I>where E: Environment, I: IntegerType,

§

fn add_assign(&mut self, other: Integer<E, I>)

Adds other to self.

§

impl<E, I> AddWrapped for Integer<E, I>where E: Environment, I: IntegerType,

§

fn add_wrapped( &self, other: &Integer<E, I> ) -> <Integer<E, I> as AddWrapped>::Output

Returns the sum of self and other.

§

type Output = Integer<E, I>

§

impl<E, I> BitAnd<&Integer<E, I>> for Integer<E, I>where E: Environment, I: IntegerType,

§

fn bitand( self, other: &Integer<E, I> ) -> <Integer<E, I> as BitAnd<&Integer<E, I>>>::Output

Returns the bitwise AND of self and other.

§

type Output = Integer<E, I>

The resulting type after applying the & operator.
§

impl<E, I> BitAnd for Integer<E, I>where E: Environment, I: IntegerType,

§

fn bitand(self, other: Integer<E, I>) -> <Integer<E, I> as BitAnd>::Output

Returns the bitwise AND of self and other.

§

type Output = Integer<E, I>

The resulting type after applying the & operator.
§

impl<E, I> BitAndAssign for Integer<E, I>where E: Environment, I: IntegerType,

§

fn bitand_assign(&mut self, other: Integer<E, I>)

Performs the bitwise AND of self and other and assigns the result to self.

§

impl<E, I> BitOr<&Integer<E, I>> for Integer<E, I>where E: Environment, I: IntegerType,

§

fn bitor( self, other: &Integer<E, I> ) -> <Integer<E, I> as BitOr<&Integer<E, I>>>::Output

Returns the bitwise OR of self and other.

§

type Output = Integer<E, I>

The resulting type after applying the | operator.
§

impl<E, I> BitOr for Integer<E, I>where E: Environment, I: IntegerType,

§

fn bitor(self, other: Integer<E, I>) -> <Integer<E, I> as BitOr>::Output

Returns the bitwise OR of self and other.

§

type Output = Integer<E, I>

The resulting type after applying the | operator.
§

impl<E, I> BitOrAssign for Integer<E, I>where E: Environment, I: IntegerType,

§

fn bitor_assign(&mut self, other: Integer<E, I>)

Performs the bitwise OR of self and other and assigns the result to self.

§

impl<E, I> BitXor<&Integer<E, I>> for Integer<E, I>where E: Environment, I: IntegerType,

§

fn bitxor( self, other: &Integer<E, I> ) -> <Integer<E, I> as BitXor<&Integer<E, I>>>::Output

Returns the bitwise XOR of self and other.

§

type Output = Integer<E, I>

The resulting type after applying the ^ operator.
§

impl<E, I> BitXor for Integer<E, I>where E: Environment, I: IntegerType,

§

fn bitxor(self, other: Integer<E, I>) -> <Integer<E, I> as BitXor>::Output

Returns the bitwise XOR of self and other.

§

type Output = Integer<E, I>

The resulting type after applying the ^ operator.
§

impl<E, I> BitXorAssign for Integer<E, I>where E: Environment, I: IntegerType,

§

fn bitxor_assign(&mut self, other: Integer<E, I>)

Performs the bitwise XOR of self and other and assigns the result to self.

source§

impl<E: Environment, I: IntegerType> Cast<Address<E>> for Integer<E, I>

source§

fn cast(&self) -> Result<Address<E>>

Casts an Integer to an Address.

This operation converts the integer to a field element, and then attempts to recover the group element by treating the field element as an x-coordinate. The group element is then converted to an address.

To cast arbitrary integers to addresses, use Integer::cast_lossy.

source§

impl<E: Environment, I: IntegerType> Cast<Boolean<E>> for Integer<E, I>

source§

fn cast(&self) -> Result<Boolean<E>>

Casts an Integer to a Boolean, if the integer is zero or one.

To cast arbitrary integers to booleans, use Integer::cast_lossy.

source§

impl<E: Environment, I: IntegerType> Cast<Field<E>> for Integer<E, I>

source§

fn cast(&self) -> Result<Field<E>>

Casts an Integer to a Field.

source§

impl<E: Environment, I: IntegerType> Cast<Group<E>> for Integer<E, I>

source§

fn cast(&self) -> Result<Group<E>>

Casts an Integer to a Group.

This operation converts the integer to a field element, and then attempts to recover the group element by treating the field element as an x-coordinate.

To cast arbitrary integers to groups, use Integer::cast_lossy.

source§

impl<E: Environment, I: IntegerType> Cast<Integer<E, I>> for Boolean<E>

source§

fn cast(&self) -> Result<Integer<E, I>>

Casts a Boolean to an Integer.

source§

impl<E: Environment, I: IntegerType> Cast<Integer<E, I>> for Field<E>

source§

fn cast(&self) -> Result<Integer<E, I>>

Casts a Field to an Integer, if the field element is in the integer’s range.

To cast arbitrary field elements to integers, use Field::cast_lossy.

source§

impl<E: Environment, I: IntegerType> Cast<Integer<E, I>> for Scalar<E>

source§

fn cast(&self) -> Result<Integer<E, I>>

Casts a Scalar to an Integer, if the scalar is in the range of the integer.

To cast arbitrary scalars to integers, via truncation, use Scalar::cast_lossy.

source§

impl<E: Environment, I0: IntegerType, I1: IntegerType + TryFrom<I0>> Cast<Integer<E, I1>> for Integer<E, I0>

source§

fn cast(&self) -> Result<Integer<E, I1>>

Casts an Integer to another Integer, if the conversion is lossless.

source§

impl<E: Environment, I: IntegerType> Cast<Scalar<E>> for Integer<E, I>

source§

fn cast(&self) -> Result<Scalar<E>>

Casts an Integer to a Scalar.

source§

impl<E: Environment, I: IntegerType> CastLossy<Address<E>> for Integer<E, I>

source§

fn cast_lossy(&self) -> Address<E>

Casts an Integer to an Address.

This operation converts the integer into a field element, and then attempts to recover the group element to construct the address. See the documentation of Field::cast_lossy on the Group type for more details.

source§

impl<E: Environment, I: IntegerType> CastLossy<Boolean<E>> for Integer<E, I>

source§

fn cast_lossy(&self) -> Boolean<E>

Casts an Integer to a Boolean, with lossy truncation. This operation returns the least significant bit of the field.

source§

impl<E: Environment, I: IntegerType> CastLossy<Field<E>> for Integer<E, I>

source§

fn cast_lossy(&self) -> Field<E>

Casts an Integer to a Field. This is safe because casting from an integer to a field is always lossless.

source§

impl<E: Environment, I: IntegerType> CastLossy<Group<E>> for Integer<E, I>

source§

fn cast_lossy(&self) -> Group<E>

Casts an Integer to a Group.

This operation converts the integer into a field element, and then attempts to recover the group element. See the documentation of Field::cast_lossy on the Group type for more details.

source§

impl<E: Environment, I: IntegerType> CastLossy<Integer<E, I>> for Boolean<E>

source§

fn cast_lossy(&self) -> Integer<E, I>

Casts a Boolean to an Integer.

source§

impl<E: Environment, I: IntegerType> CastLossy<Integer<E, I>> for Field<E>

source§

fn cast_lossy(&self) -> Integer<E, I>

Casts a Field to an Integer, with lossy truncation. This operation truncates the field to an integer.

source§

impl<E: Environment, I: IntegerType> CastLossy<Integer<E, I>> for Scalar<E>

source§

fn cast_lossy(&self) -> Integer<E, I>

Casts a Scalar to an Integer, with lossy truncation.

source§

impl<E: Environment, I0: IntegerType + AsPrimitive<I1>, I1: IntegerType> CastLossy<Integer<E, I1>> for Integer<E, I0>

source§

fn cast_lossy(&self) -> Integer<E, I1>

Casts an Integer to an Integer of a different type, with lossy truncation.

source§

impl<E: Environment, I: IntegerType> CastLossy<Scalar<E>> for Integer<E, I>

source§

fn cast_lossy(&self) -> Scalar<E>

Casts an Integer to a Scalar. This is safe because casting from an integer to a scalar is always lossless.

§

impl<E, I> Clone for Integer<E, I>where E: Clone + Environment, I: Clone + IntegerType,

§

fn clone(&self) -> Integer<E, I>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<E, I> Compare for Integer<E, I>where E: Environment, I: IntegerType,

§

fn is_less_than( &self, other: &Integer<E, I> ) -> <Integer<E, I> as Compare>::Output

Returns true if self is less than other.

§

fn is_greater_than( &self, other: &Integer<E, I> ) -> <Integer<E, I> as Compare>::Output

Returns true if self is greater than other.

§

fn is_less_than_or_equal( &self, other: &Integer<E, I> ) -> <Integer<E, I> as Compare>::Output

Returns true if self is less than or equal to other.

§

fn is_greater_than_or_equal( &self, other: &Integer<E, I> ) -> <Integer<E, I> as Compare>::Output

Returns true if self is greater than or equal to other.

§

type Output = Boolean<E>

§

impl<E, I> Debug for Integer<E, I>where E: Environment, I: IntegerType,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<E, I> Deref for Integer<E, I>where E: Environment, I: IntegerType,

§

type Target = I

The resulting type after dereferencing.
§

fn deref(&self) -> &<Integer<E, I> as Deref>::Target

Dereferences the value.
§

impl<'de, E, I> Deserialize<'de> for Integer<E, I>where E: Environment, I: IntegerType,

§

fn deserialize<D>( deserializer: D ) -> Result<Integer<E, I>, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,

Deserializes the integer from a string or bytes.

§

impl<E, I> Display for Integer<E, I>where E: Environment, I: IntegerType,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<E, I> Distribution<Integer<E, I>> for Standardwhere E: Environment, I: IntegerType,

§

fn sample<R>(&self, rng: &mut R) -> Integer<E, I>where R: Rng + ?Sized,

Generate a random value of T, using rng as the source of randomness.
source§

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
source§

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
§

impl<E, I> Div<&Integer<E, I>> for Integer<E, I>where E: Environment, I: IntegerType,

§

fn div( self, other: &Integer<E, I> ) -> <Integer<E, I> as Div<&Integer<E, I>>>::Output

Returns the quotient of self and other.

§

type Output = Integer<E, I>

The resulting type after applying the / operator.
§

impl<E, I> Div for Integer<E, I>where E: Environment, I: IntegerType,

§

fn div(self, other: Integer<E, I>) -> <Integer<E, I> as Div>::Output

Returns the quotient of self and other.

§

type Output = Integer<E, I>

The resulting type after applying the / operator.
§

impl<E, I> DivAssign<&Integer<E, I>> for Integer<E, I>where E: Environment, I: IntegerType,

§

fn div_assign(&mut self, other: &Integer<E, I>)

Divides self by other.

§

impl<E, I> DivAssign for Integer<E, I>where E: Environment, I: IntegerType,

§

fn div_assign(&mut self, other: Integer<E, I>)

Divides self by other.

§

impl<E, I> DivWrapped for Integer<E, I>where E: Environment, I: IntegerType,

§

fn div_wrapped( &self, other: &Integer<E, I> ) -> <Integer<E, I> as DivWrapped>::Output

Returns the quotient of self and other.

§

type Output = Integer<E, I>

§

impl<E, I> Equal for Integer<E, I>where E: Environment, I: IntegerType,

§

fn is_equal(&self, other: &Integer<E, I>) -> <Integer<E, I> as Equal>::Output

Returns true if self and other are equal.

§

fn is_not_equal( &self, other: &Integer<E, I> ) -> <Integer<E, I> as Equal>::Output

Returns true if self and other are not equal.

§

type Output = Boolean<E>

source§

impl<N: Network> From<Integer<N, u32>> for Access<N>

source§

fn from(index: U32<N>) -> Self

Initializes a new index access from a u32.

§

impl<E, I> FromBits for Integer<E, I>where E: Environment, I: IntegerType,

§

fn from_bits_le(bits_le: &[bool]) -> Result<Integer<E, I>, Error>

Initializes a new integer from a list of little-endian bits.

§

fn from_bits_be(bits_be: &[bool]) -> Result<Integer<E, I>, Error>

Initializes a new integer from a list of big-endian bits.

§

impl<E, I> FromBytes for Integer<E, I>where E: Environment, I: IntegerType,

§

fn read_le<R>(reader: R) -> Result<Integer<E, I>, Error>where R: Read,

Reads the integer from a buffer.

source§

fn from_bytes_le(bytes: &[u8]) -> Result<Self, Error>where Self: Sized,

Returns Self from a byte array in little-endian order.
§

impl<E, I> FromField for Integer<E, I>where E: Environment, I: IntegerType,

§

fn from_field( field: &<Integer<E, I> as FromField>::Field ) -> Result<Integer<E, I>, Error>

Casts an integer from a base field.

This method guarantees the following:

  1. If the field element is larger than the integer domain, then the operation will fail.
  2. If the field element is smaller than the integer domain, then the operation will succeed.
§

type Field = Field<E>

§

impl<E, I> FromFields for Integer<E, I>where E: Environment, I: IntegerType,

§

fn from_fields( fields: &[<Integer<E, I> as FromFields>::Field] ) -> Result<Integer<E, I>, Error>

Initializes a new integer by recovering the x-coordinate of an affine group from a field element.

§

type Field = Field<E>

§

impl<E, I> FromStr for Integer<E, I>where E: Environment, I: IntegerType,

§

fn from_str(string: &str) -> Result<Integer<E, I>, Error>

Parses a string into an integer.

§

type Err = Error

The associated error which can be returned from parsing.
§

impl<E, I> Hash for Integer<E, I>where E: Hash + Environment, I: Hash + IntegerType,

§

fn hash<__H>(&self, state: &mut __H)where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<E, I> Modulo for Integer<E, I>where E: Environment, I: IntegerType,

§

fn modulo(&self, other: &Integer<E, I>) -> Integer<E, I>

Returns the result of taking the modulus of self with respect to other.

§

type Output = Integer<E, I>

§

impl<E, I> Mul<&Integer<E, I>> for Integer<E, I>where E: Environment, I: IntegerType,

§

fn mul( self, other: &Integer<E, I> ) -> <Integer<E, I> as Mul<&Integer<E, I>>>::Output

Returns the product of self and other.

§

type Output = Integer<E, I>

The resulting type after applying the * operator.
§

impl<E, I> Mul for Integer<E, I>where E: Environment, I: IntegerType,

§

fn mul(self, other: Integer<E, I>) -> <Integer<E, I> as Mul>::Output

Returns the product of self and other.

§

type Output = Integer<E, I>

The resulting type after applying the * operator.
§

impl<E, I> MulAssign<&Integer<E, I>> for Integer<E, I>where E: Environment, I: IntegerType,

§

fn mul_assign(&mut self, other: &Integer<E, I>)

Multiplies self by other.

§

impl<E, I> MulAssign for Integer<E, I>where E: Environment, I: IntegerType,

§

fn mul_assign(&mut self, other: Integer<E, I>)

Multiplies self by other.

§

impl<E, I> MulWrapped for Integer<E, I>where E: Environment, I: IntegerType,

§

fn mul_wrapped( &self, other: &Integer<E, I> ) -> <Integer<E, I> as MulWrapped>::Output

Returns the product of self and other.

§

type Output = Integer<E, I>

§

impl<E, I> Neg for Integer<E, I>where E: Environment, I: IntegerType,

§

fn neg(self) -> <Integer<E, I> as Neg>::Output

Returns the negation of self.

§

type Output = Integer<E, I>

The resulting type after applying the - operator.
§

impl<E, I> Not for Integer<E, I>where E: Environment, I: IntegerType,

§

fn not(self) -> <Integer<E, I> as Not>::Output

Returns the bitwise NOT of self.

§

type Output = Integer<E, I>

The resulting type after applying the ! operator.
§

impl<E, I> One for Integer<E, I>where E: Environment, I: IntegerType,

§

fn one() -> Integer<E, I>

Returns the 1 element of the integer.

§

fn is_one(&self) -> bool

Returns true if the element is one.

source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
§

impl<E, I> Ord for Integer<E, I>where E: Environment, I: IntegerType,

§

fn cmp(&self, other: &Integer<E, I>) -> Ordering

Returns the lexicographic ordering of self and other.

1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl<E, I> Parser for Integer<E, I>where E: Environment, I: IntegerType,

§

fn parse(string: &str) -> Result<(&str, Integer<E, I>), Err<VerboseError<&str>>>

Parses a string into a integer circuit.

§

impl<E, I> PartialEq for Integer<E, I>where E: PartialEq + Environment, I: PartialEq + IntegerType,

§

fn eq(&self, other: &Integer<E, I>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<E, I> PartialOrd for Integer<E, I>where E: Environment, I: IntegerType,

§

fn partial_cmp(&self, other: &Integer<E, I>) -> Option<Ordering>

Returns the lexicographic ordering of self and other.

1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl<E, I, M> Pow<&Integer<E, M>> for Integer<E, I>where E: Environment, I: IntegerType, M: Magnitude,

§

fn pow( self, other: &Integer<E, M> ) -> <Integer<E, I> as Pow<&Integer<E, M>>>::Output

Returns the power of self to the power of other.

§

type Output = Integer<E, I>

The result after applying the operator.
§

impl<E, I, M> Pow<Integer<E, M>> for Integer<E, I>where E: Environment, I: IntegerType, M: Magnitude,

§

fn pow( self, other: Integer<E, M> ) -> <Integer<E, I> as Pow<Integer<E, M>>>::Output

Returns the power of self to the power of other.

§

type Output = Integer<E, I>

The result after applying the operator.
§

impl<E, I, M> PowWrapped<Integer<E, M>> for Integer<E, I>where E: Environment, I: IntegerType, M: Magnitude,

§

fn pow_wrapped( &self, other: &Integer<E, M> ) -> <Integer<E, I> as PowWrapped<Integer<E, M>>>::Output

Returns the power of self to the power of other.

§

type Output = Integer<E, I>

§

impl<E, I> Rem<&Integer<E, I>> for Integer<E, I>where E: Environment, I: IntegerType,

§

fn rem(self, other: &Integer<E, I>) -> Integer<E, I>

Returns the remainder of self divided by other.

§

type Output = Integer<E, I>

The resulting type after applying the % operator.
§

impl<E, I> Rem for Integer<E, I>where E: Environment, I: IntegerType,

§

fn rem(self, other: Integer<E, I>) -> Integer<E, I>

Returns the remainder of self divided by other.

§

type Output = Integer<E, I>

The resulting type after applying the % operator.
§

impl<E, I> RemAssign<&Integer<E, I>> for Integer<E, I>where E: Environment, I: IntegerType,

§

fn rem_assign(&mut self, other: &Integer<E, I>)

Returns the remainder of self divided by other.

§

impl<E, I> RemAssign for Integer<E, I>where E: Environment, I: IntegerType,

§

fn rem_assign(&mut self, other: Integer<E, I>)

Returns the remainder of self divided by other.

§

impl<E, I> RemWrapped for Integer<E, I>where E: Environment, I: IntegerType,

§

fn rem_wrapped( &self, other: &Integer<E, I> ) -> <Integer<E, I> as RemWrapped>::Output

Returns the remainder of self divided by other.

§

type Output = Integer<E, I>

§

impl<E, I> Serialize for Integer<E, I>where E: Environment, I: IntegerType,

§

fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,

Serializes the integer into a string or as bytes.

§

impl<E, I, M> Shl<&Integer<E, M>> for Integer<E, I>where E: Environment, I: IntegerType, M: Magnitude,

§

fn shl( self, n: &Integer<E, M> ) -> <Integer<E, I> as Shl<&Integer<E, M>>>::Output

Shifts self to the left by n bits.

§

type Output = Integer<E, I>

The resulting type after applying the << operator.
§

impl<E, I, M> Shl<Integer<E, M>> for Integer<E, I>where E: Environment, I: IntegerType, M: Magnitude,

§

fn shl(self, n: Integer<E, M>) -> <Integer<E, I> as Shl<Integer<E, M>>>::Output

Shifts self to the left by n bits.

§

type Output = Integer<E, I>

The resulting type after applying the << operator.
§

impl<E, I, M> ShlAssign<Integer<E, M>> for Integer<E, I>where E: Environment, I: IntegerType, M: Magnitude,

§

fn shl_assign(&mut self, n: Integer<E, M>)

Shifts self to the left by n bits and assigns the result to self.

§

impl<E, I, M> ShlChecked<Integer<E, M>> for Integer<E, I>where E: Environment, I: IntegerType, M: Magnitude,

§

fn shl_checked( &self, n: &Integer<E, M> ) -> <Integer<E, I> as ShlChecked<Integer<E, M>>>::Output

Shifts self to the left by n bits.

§

type Output = Integer<E, I>

§

impl<E, I, M> ShlWrapped<Integer<E, M>> for Integer<E, I>where E: Environment, I: IntegerType, M: Magnitude,

§

fn shl_wrapped( &self, n: &Integer<E, M> ) -> <Integer<E, I> as ShlWrapped<Integer<E, M>>>::Output

Shifts self to the left by n bits, continuing past the boundary.

§

type Output = Integer<E, I>

§

impl<E, I, M> Shr<&Integer<E, M>> for Integer<E, I>where E: Environment, I: IntegerType, M: Magnitude,

§

fn shr( self, n: &Integer<E, M> ) -> <Integer<E, I> as Shr<&Integer<E, M>>>::Output

Shifts self to the right by n bits.

§

type Output = Integer<E, I>

The resulting type after applying the >> operator.
§

impl<E, I, M> Shr<Integer<E, M>> for Integer<E, I>where E: Environment, I: IntegerType, M: Magnitude,

§

fn shr(self, n: Integer<E, M>) -> <Integer<E, I> as Shr<Integer<E, M>>>::Output

Shifts self to the right by n bits.

§

type Output = Integer<E, I>

The resulting type after applying the >> operator.
§

impl<E, I, M> ShrAssign<Integer<E, M>> for Integer<E, I>where E: Environment, I: IntegerType, M: Magnitude,

§

fn shr_assign(&mut self, n: Integer<E, M>)

Shifts self to the right by n bits and assigns the result to self.

§

impl<E, I, M> ShrChecked<Integer<E, M>> for Integer<E, I>where E: Environment, I: IntegerType, M: Magnitude,

§

fn shr_checked( &self, n: &Integer<E, M> ) -> <Integer<E, I> as ShrChecked<Integer<E, M>>>::Output

Shifts self to the right by n bits.

§

type Output = Integer<E, I>

§

impl<E, I, M> ShrWrapped<Integer<E, M>> for Integer<E, I>where E: Environment, I: IntegerType, M: Magnitude,

§

fn shr_wrapped( &self, n: &Integer<E, M> ) -> <Integer<E, I> as ShrWrapped<Integer<E, M>>>::Output

Shifts self to the right by n bits, continuing past the boundary.

§

type Output = Integer<E, I>

§

impl<E, I> SizeInBits for Integer<E, I>where E: Environment, I: IntegerType,

§

fn size_in_bits() -> usize

Returns the integer size in bits.

§

impl<E, I> SizeInBytes for Integer<E, I>where E: Environment, I: IntegerType,

§

fn size_in_bytes() -> usize

Returns the integer size in bytes.

§

impl<E, I> Square for Integer<E, I>where E: Environment, I: IntegerType,

§

fn square(&self) -> <Integer<E, I> as Square>::Output

Returns the square of self.

§

type Output = Integer<E, I>

§

impl<E, I> Sub<&Integer<E, I>> for Integer<E, I>where E: Environment, I: IntegerType,

§

fn sub( self, other: &Integer<E, I> ) -> <Integer<E, I> as Sub<&Integer<E, I>>>::Output

Returns the difference of self and other.

§

type Output = Integer<E, I>

The resulting type after applying the - operator.
§

impl<E, I> Sub for Integer<E, I>where E: Environment, I: IntegerType,

§

fn sub(self, other: Integer<E, I>) -> <Integer<E, I> as Sub>::Output

Returns the difference of self and other.

§

type Output = Integer<E, I>

The resulting type after applying the - operator.
§

impl<E, I> SubAssign<&Integer<E, I>> for Integer<E, I>where E: Environment, I: IntegerType,

§

fn sub_assign(&mut self, other: &Integer<E, I>)

Subtracts other from self.

§

impl<E, I> SubAssign for Integer<E, I>where E: Environment, I: IntegerType,

§

fn sub_assign(&mut self, other: Integer<E, I>)

Subtracts other from self.

§

impl<E, I> SubWrapped for Integer<E, I>where E: Environment, I: IntegerType,

§

fn sub_wrapped( &self, other: &Integer<E, I> ) -> <Integer<E, I> as SubWrapped>::Output

Returns the difference of self and other.

§

type Output = Integer<E, I>

§

impl<E, I> Ternary for Integer<E, I>where E: Environment, I: IntegerType,

§

fn ternary( condition: &<Integer<E, I> as Ternary>::Boolean, first: &Integer<E, I>, second: &Integer<E, I> ) -> <Integer<E, I> as Ternary>::Output

Returns first if condition is true, otherwise returns second.

§

type Boolean = Boolean<E>

§

type Output = Integer<E, I>

§

impl<E, I> ToBits for Integer<E, I>where E: Environment, I: IntegerType,

§

fn write_bits_le(&self, vec: &mut Vec<bool>)

Outputs the little-endian bit representation of self without trailing zeros.

§

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>

Returns self as a boolean array in little-endian order.
source§

fn to_bits_be(&self) -> Vec<bool>

Returns self as a boolean array in big-endian order.
source§

fn num_bits() -> Option<usize>

An optional indication of how many bits an object can be represented with.
§

impl<E, I> ToBytes for Integer<E, I>where E: Environment, I: IntegerType,

§

fn write_le<W>(&self, writer: W) -> Result<(), Error>where W: Write,

Writes the integer to a buffer.

source§

fn to_bytes_le(&self) -> Result<Vec<u8>, Error>where Self: Sized,

Returns self as a byte array in little-endian order.
§

impl<E, I> ToField for Integer<E, I>where E: Environment, I: IntegerType,

§

fn to_field(&self) -> Result<<Integer<E, I> as ToField>::Field, Error>

Converts an integer into a field element.

§

type Field = Field<E>

§

impl<E, I> ToFields for Integer<E, I>where E: Environment, I: IntegerType,

§

fn to_fields(&self) -> Result<Vec<<Integer<E, I> as ToFields>::Field>, Error>

Returns the integer as field elements.

§

type Field = Field<E>

§

impl<E, I> TypeName for Integer<E, I>where E: Environment, I: IntegerType,

§

fn type_name() -> &'static str

Returns the type name as a string.

§

impl<E, I> Visibility for Integer<E, I>where E: Environment, I: IntegerType,

§

fn size_in_fields(&self) -> Result<u16, Error>

Returns the number of field elements to encode self.

§

type Boolean = Boolean<E>

§

impl<E, I> Zero for Integer<E, I>where E: Environment, I: IntegerType,

§

fn zero() -> Integer<E, I>

Returns the 0 element of the integer.

§

fn is_zero(&self) -> bool

Returns true if the element is zero.

source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
§

impl<E, I> Copy for Integer<E, I>where E: Copy + Environment, I: Copy + IntegerType,

§

impl<E, I> Eq for Integer<E, I>where E: Eq + Environment, I: Eq + IntegerType,

§

impl<E, I> IntegerCore<I> for Integer<E, I>where E: Environment, I: IntegerType,

§

impl<E, I> IntegerTrait<I, Integer<E, u8>, Integer<E, u16>, Integer<E, u32>> for Integer<E, I>where E: Environment, I: IntegerType,

§

impl<E, I> StructuralEq for Integer<E, I>where E: Environment, I: IntegerType,

§

impl<E, I> StructuralPartialEq for Integer<E, I>where E: Environment, I: IntegerType,

Auto Trait Implementations§

§

impl<E, I> RefUnwindSafe for Integer<E, I>where E: RefUnwindSafe, I: RefUnwindSafe,

§

impl<E, I> Send for Integer<E, I>

§

impl<E, I> Sync for Integer<E, I>

§

impl<E, I> Unpin for Integer<E, I>where E: Unpin, I: Unpin,

§

impl<E, I> UnwindSafe for Integer<E, I>where E: UnwindSafe, I: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Comparable<K> for Qwhere Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
source§

impl<'de, T> DeserializeExt<'de> for Twhere T: DeserializeOwned,

source§

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,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Uniform for Twhere Standard: Distribution<T>,

source§

fn rand<R>(rng: &mut R) -> Twhere R: Rng + ?Sized,

Samples a random value from a uniform distribution.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,

source§

impl<T, Rhs> NumAssignOps<Rhs> for Twhere T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for Twhere T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

source§

impl<T, Base> RefNum<Base> for Twhere T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,