Skip to main content

ConstCheckedPow

Trait ConstCheckedPow 

Source
pub trait ConstCheckedPow:
    Sized
    + ConstOne
    + ConstCheckedMul {
    // Required method
    fn checked_pow(self, exp: u32) -> Option<Self>;
}
Expand description

Const-compatible checked exponentiation.

Returns None if the result would overflow.

Required Methods§

Source

fn checked_pow(self, exp: u32) -> Option<Self>

Checked exponentiation. Computes self.pow(exp), returning None if overflow occurred.

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.

Implementations on Foreign Types§

Source§

impl ConstCheckedPow for u8

Source§

fn checked_pow(self, exp: u32) -> Option<Self>

Source§

impl ConstCheckedPow for u16

Source§

fn checked_pow(self, exp: u32) -> Option<Self>

Source§

impl ConstCheckedPow for u32

Source§

fn checked_pow(self, exp: u32) -> Option<Self>

Source§

impl ConstCheckedPow for u64

Source§

fn checked_pow(self, exp: u32) -> Option<Self>

Source§

impl ConstCheckedPow for u128

Source§

fn checked_pow(self, exp: u32) -> Option<Self>

Implementors§

Source§

impl<T: ConstMachineWord + MachineWord, const N: usize> ConstCheckedPow for FixedUInt<T, N>