Trait prio::field::Integer

source ·
pub trait Integer: Debug + Eq + Ord + BitAnd<Output = Self> + Div<Output = Self> + Shl<usize, Output = Self> + Shr<usize, Output = Self> + Add<Output = Self> + Sub<Output = Self> + TryFrom<usize, Error = Self::TryFromUsizeError> + TryInto<u64, Error = Self::TryIntoU64Error> {
    type TryFromUsizeError: Error;
    type TryIntoU64Error: Error;

    // Required methods
    fn zero() -> Self;
    fn one() -> Self;
}
Expand description

An integer type that accompanies a finite field. Integers and field elements may be converted back and forth via the natural map between residue classes modulo ‘p’ and integers between 0 and p - 1.

Required Associated Types§

source

type TryFromUsizeError: Error

The error returned if converting usize to this integer type fails.

source

type TryIntoU64Error: Error

The error returned if converting this integer type to a u64 fails.

Required Methods§

source

fn zero() -> Self

Returns zero.

source

fn one() -> Self

Returns one.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Integer for u32

source§

impl Integer for u64

source§

impl Integer for u128

Implementors§