[][src]Trait modtype::UnsignedPrimitive

pub trait UnsignedPrimitive: Sealed + Unsigned + PrimInt + Integer + Num<FromStrRadixErr = ParseIntError> + Bounded + FromStr<Err = ParseIntError> + FromPrimitive + Into<BigUint> + Into<BigInt> + Default + Display + Debug + LowerHex + UpperHex + Sum + Product + AddAssign + SubAssign + MulAssign + DivAssign + RemAssign + BitAndAssign + BitOrAssign + BitXorAssign + Send + Sync + 'static {
    type Signed: SignedPrimitive;
    type Range: DoubleEndedIterator<Item = Self>;
    fn random<R: Rng>(rng: &mut R) -> Self;
fn try_from_biguint(biguint: BigUint) -> Option<Self>;
fn try_from_bigint(bigint: BigInt) -> Option<Self>;
fn try_from_signed(signed: Self::Signed) -> Option<Self>;
fn try_into_signed(self) -> Option<Self::Signed>;
fn rem_biguint(self, biguint: BigUint) -> BigUint;
fn rem_bigint(self, bigint: BigInt) -> BigInt;
fn range(self, end: Self) -> Self::Range;
fn thread_local_modulus_key() -> &'static LocalKey<UnsafeCell<Self>>; unsafe fn thread_local_modulus() -> Self { ... }
unsafe fn set_thread_local_modulus(modulus: Self) { ... } }

A trait for u8, u16, u32, u64, u128, and usize.

Associated Types

Loading content...

Required methods

fn random<R: Rng>(rng: &mut R) -> Self

fn try_from_biguint(biguint: BigUint) -> Option<Self>

fn try_from_bigint(bigint: BigInt) -> Option<Self>

fn try_from_signed(signed: Self::Signed) -> Option<Self>

fn try_into_signed(self) -> Option<Self::Signed>

fn rem_biguint(self, biguint: BigUint) -> BigUint

fn rem_bigint(self, bigint: BigInt) -> BigInt

fn range(self, end: Self) -> Self::Range

fn thread_local_modulus_key() -> &'static LocalKey<UnsafeCell<Self>>

Loading content...

Provided methods

unsafe fn thread_local_modulus() -> Self

Safety

This function is safe as long as Self::thread_local_modulus_key().with does not leak the raw pointer.

unsafe fn set_thread_local_modulus(modulus: Self)

Safety

This function is safe as long as Self::thread_local_modulus_key().with does not leak the raw pointer.

Loading content...

Implementations on Foreign Types

impl UnsignedPrimitive for u8[src]

type Signed = i8

type Range = Range<u8>

impl UnsignedPrimitive for u16[src]

type Signed = i16

type Range = Range<u16>

impl UnsignedPrimitive for u32[src]

type Signed = i32

type Range = Range<u32>

impl UnsignedPrimitive for u64[src]

type Signed = i64

type Range = Range<u64>

impl UnsignedPrimitive for u128[src]

type Signed = i128

type Range = Range<u128>

impl UnsignedPrimitive for usize[src]

type Signed = isize

type Range = Range<usize>

Loading content...

Implementors

Loading content...