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>;
// 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>>;
// Provided methods
unsafe fn thread_local_modulus() -> Self { ... }
unsafe fn set_thread_local_modulus(modulus: Self) { ... }
}Expand description
A trait for u8, u16, u32, u64, u128, and usize.
Required Associated Types§
type Signed: SignedPrimitive
type Range: DoubleEndedIterator<Item = Self>
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>>
Provided Methods§
Sourceunsafe fn thread_local_modulus() -> Self
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.
Sourceunsafe fn set_thread_local_modulus(modulus: Self)
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.