Divisors

Trait Divisors 

Source
pub trait Divisors: Sized {
    // Required method
    fn divisors_unordered(&self) -> Vec<Self>;

    // Provided method
    fn divisors(&self) -> Vec<Self>
       where Self: Ord { ... }
}
Expand description

Trait for getting all positive divisors of an integer.

Required Methods§

Source

fn divisors_unordered(&self) -> Vec<Self>

Returns the list of divisors of self in no particular order.

Provided Methods§

Source

fn divisors(&self) -> Vec<Self>
where Self: Ord,

Returns the list of divisors of self in the ascending order.

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 Divisors for u8

Source§

fn divisors_unordered(&self) -> Vec<Self>

Source§

impl Divisors for u16

Source§

fn divisors_unordered(&self) -> Vec<Self>

Source§

impl Divisors for u32

Source§

fn divisors_unordered(&self) -> Vec<Self>

Source§

impl Divisors for u64

Source§

fn divisors_unordered(&self) -> Vec<Self>

Source§

impl Divisors for u128

Source§

fn divisors_unordered(&self) -> Vec<Self>

Source§

impl Divisors for usize

Source§

fn divisors_unordered(&self) -> Vec<Self>

Implementors§