devela::all

Trait NumRefInt

Source
pub trait NumRefInt<'a>: NumRef<'a>
where Self: Deref<Target = <Self as NumRef<'a>>::Own>, <Self as NumRef<'a>>::Own: NumInt,
{
Show 57 methods // Provided methods fn int_ref_digital_root(&self) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_digital_root_base( &self, base: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_digits(&self) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_digits_sign(&self) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_digits_base( &self, base: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_digits_base_sign( &self, base: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_abs(&self) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_is_even(&self) -> Result<bool> { ... } fn int_ref_is_odd(&self) -> Result<bool> { ... } fn int_ref_gcd( &self, other: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_gcd_ext( &self, other: &<Self::Own as Num>::Rhs, ) -> Result<GcdReturn<<Self::Own as Num>::Out, <Self::Own as NumInt>::OutI>> { ... } fn int_ref_lcm( &self, other: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_scale( &self, min: &<Self::Own as Num>::Rhs, max: &<Self::Own as Num>::Rhs, a: &<Self::Own as Num>::Rhs, b: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_scale_wrap( &self, min: &<Self::Own as Num>::Rhs, max: &<Self::Own as Num>::Rhs, a: &<Self::Own as Num>::Rhs, b: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_midpoint( &self, other: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_factorial(&self) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_subfactorial(&self) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_permute( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_permute_rep( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_combine( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_combine_rep( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_div_rem( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<[<Self::Own as Num>::Out; 2]> { ... } fn int_ref_div_ceil( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_div_floor( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_div_ties_away( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_div_ties_towards( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_div_ties_even( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_div_ties_odd( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_factors(&self) -> Result<Vec<<Self::Own as Num>::Out>> { ... } fn int_ref_factors_proper(&self) -> Result<Vec<<Self::Own as Num>::Out>> { ... } fn int_ref_factors_prime(&self) -> Result<Vec<<Self::Own as Num>::Out>> { ... } fn int_ref_factors_prime_unique( &self, ) -> Result<Vec<<Self::Own as Num>::Out>> { ... } fn int_ref_factors_buf( &self, fbuf: &mut [<Self::Own as Num>::Out], upfbuf: &mut [<Self::Own as Num>::Out], ) -> Result<(usize, usize)> { ... } fn int_ref_factors_proper_buf( &self, fbuf: &mut [<Self::Own as Num>::Out], upfbuf: &mut [<Self::Own as Num>::Out], ) -> Result<(usize, usize)> { ... } fn int_ref_factors_prime_buf( &self, buffer: &mut [<Self::Own as Num>::Out], ) -> Result<usize> { ... } fn int_ref_factors_prime_unique_buf( &self, buffer: &mut [<Self::Own as Num>::Out], ) -> Result<usize> { ... } fn int_ref_is_prime(&self) -> Result<bool> { ... } fn int_ref_prime_nth(&self) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_prime_pi(&self) -> Result<usize> { ... } fn int_ref_totient(&self) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_is_square(&self) -> Result<bool> { ... } fn int_ref_sqrt_ceil(&self) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_sqrt_floor(&self) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_sqrt_round(&self) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_modulo( &self, modulus: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_modulo_cycles( &self, modulus: &<Self::Own as Num>::Rhs, ) -> Result<ValueQuant<<Self::Own as Num>::Out, <Self::Own as Num>::Out>> { ... } fn int_ref_modulo_add( &self, other: &<Self::Own as Num>::Rhs, modulus: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_modulo_add_cycles( &self, other: &<Self::Own as Num>::Rhs, modulus: &<Self::Own as Num>::Rhs, ) -> Result<ValueQuant<<Self::Own as Num>::Out, <Self::Own as Num>::Out>> { ... } fn int_ref_modulo_add_inv( &self, modulus: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_modulo_sub( &self, other: &<Self::Own as Num>::Rhs, modulus: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_modulo_sub_cycles( &self, other: &<Self::Own as Num>::Rhs, modulus: &<Self::Own as Num>::Rhs, ) -> Result<ValueQuant<<Self::Own as Num>::Out, <Self::Own as Num>::Out>> { ... } fn int_ref_modulo_mul( &self, other: &<Self::Own as Num>::Rhs, modulus: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_modulo_mul_cycles( &self, other: &<Self::Own as Num>::Rhs, modulus: &<Self::Own as Num>::Rhs, ) -> Result<ValueQuant<<Self::Own as Num>::Out, <Self::Own as Num>::Out>> { ... } fn int_ref_modulo_mul_inv( &self, modulus: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_modulo_div( &self, other: &<Self::Own as Num>::Rhs, modulus: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_root_ceil(&self, nth: u32) -> Result<<Self::Own as Num>::Out> { ... } fn int_ref_root_floor(&self, nth: u32) -> Result<<Self::Own as Num>::Out> { ... }
}
Expand description

Common auto-trait for referenced integer types.

§Notes

  • This is automatically implemented for references of types implementing NumInt.
  • Mutable operations are only available for exclusive (&mut) references.

Provided Methods§

Source

fn int_ref_digital_root(&self) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_digital_root_base( &self, base: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_digits(&self) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_digits_sign(&self) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_digits_base( &self, base: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_digits_base_sign( &self, base: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_abs(&self) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_is_even(&self) -> Result<bool>

Source

fn int_ref_is_odd(&self) -> Result<bool>

Source

fn int_ref_gcd( &self, other: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_gcd_ext( &self, other: &<Self::Own as Num>::Rhs, ) -> Result<GcdReturn<<Self::Own as Num>::Out, <Self::Own as NumInt>::OutI>>

Source

fn int_ref_lcm( &self, other: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_scale( &self, min: &<Self::Own as Num>::Rhs, max: &<Self::Own as Num>::Rhs, a: &<Self::Own as Num>::Rhs, b: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_scale_wrap( &self, min: &<Self::Own as Num>::Rhs, max: &<Self::Own as Num>::Rhs, a: &<Self::Own as Num>::Rhs, b: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_midpoint( &self, other: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_factorial(&self) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_subfactorial(&self) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_permute( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_permute_rep( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_combine( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_combine_rep( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_div_rem( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<[<Self::Own as Num>::Out; 2]>

Source

fn int_ref_div_ceil( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_div_floor( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_div_ties_away( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_div_ties_towards( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_div_ties_even( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_div_ties_odd( &self, r: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_factors(&self) -> Result<Vec<<Self::Own as Num>::Out>>

Available on crate feature alloc only.
Source

fn int_ref_factors_proper(&self) -> Result<Vec<<Self::Own as Num>::Out>>

Available on crate feature alloc only.
Source

fn int_ref_factors_prime(&self) -> Result<Vec<<Self::Own as Num>::Out>>

Available on crate feature alloc only.
Source

fn int_ref_factors_prime_unique(&self) -> Result<Vec<<Self::Own as Num>::Out>>

Available on crate feature alloc only.
Source

fn int_ref_factors_buf( &self, fbuf: &mut [<Self::Own as Num>::Out], upfbuf: &mut [<Self::Own as Num>::Out], ) -> Result<(usize, usize)>

Source

fn int_ref_factors_proper_buf( &self, fbuf: &mut [<Self::Own as Num>::Out], upfbuf: &mut [<Self::Own as Num>::Out], ) -> Result<(usize, usize)>

Source

fn int_ref_factors_prime_buf( &self, buffer: &mut [<Self::Own as Num>::Out], ) -> Result<usize>

Source

fn int_ref_factors_prime_unique_buf( &self, buffer: &mut [<Self::Own as Num>::Out], ) -> Result<usize>

Source

fn int_ref_is_prime(&self) -> Result<bool>

Source

fn int_ref_prime_nth(&self) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_prime_pi(&self) -> Result<usize>

Source

fn int_ref_totient(&self) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_is_square(&self) -> Result<bool>

Source

fn int_ref_sqrt_ceil(&self) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_sqrt_floor(&self) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_sqrt_round(&self) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_modulo( &self, modulus: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_modulo_cycles( &self, modulus: &<Self::Own as Num>::Rhs, ) -> Result<ValueQuant<<Self::Own as Num>::Out, <Self::Own as Num>::Out>>

Source

fn int_ref_modulo_add( &self, other: &<Self::Own as Num>::Rhs, modulus: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_modulo_add_cycles( &self, other: &<Self::Own as Num>::Rhs, modulus: &<Self::Own as Num>::Rhs, ) -> Result<ValueQuant<<Self::Own as Num>::Out, <Self::Own as Num>::Out>>

Source

fn int_ref_modulo_add_inv( &self, modulus: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_modulo_sub( &self, other: &<Self::Own as Num>::Rhs, modulus: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_modulo_sub_cycles( &self, other: &<Self::Own as Num>::Rhs, modulus: &<Self::Own as Num>::Rhs, ) -> Result<ValueQuant<<Self::Own as Num>::Out, <Self::Own as Num>::Out>>

Source

fn int_ref_modulo_mul( &self, other: &<Self::Own as Num>::Rhs, modulus: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_modulo_mul_cycles( &self, other: &<Self::Own as Num>::Rhs, modulus: &<Self::Own as Num>::Rhs, ) -> Result<ValueQuant<<Self::Own as Num>::Out, <Self::Own as Num>::Out>>

Source

fn int_ref_modulo_mul_inv( &self, modulus: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_modulo_div( &self, other: &<Self::Own as Num>::Rhs, modulus: &<Self::Own as Num>::Rhs, ) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_root_ceil(&self, nth: u32) -> Result<<Self::Own as Num>::Out>

Source

fn int_ref_root_floor(&self, nth: u32) -> Result<<Self::Own as Num>::Out>

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<T: NumInt> NumRefInt<'_> for &T

Source§

impl<T: NumInt> NumRefInt<'_> for &mut T

Implementors§