[][src]Struct primes::Sieve

pub struct Sieve { /* fields omitted */ }

A prime generator, using the Sieve of Eratosthenes method. This is asymptotically more efficient than the Trial Division method, but slower earlier on.

Create with let mut pset = Sieve::new(), and then use pset.iter() to iterate over all primes.


impl Sieve[src]

pub fn new() -> Sieve[src]

A new prime generator, primed with 2 and 3

Trait Implementations

impl Clone for Sieve[src]

impl Default for Sieve[src]

impl PrimeSetBasics for Sieve[src]

fn expand(&mut self)[src]

Finds one more prime, and adds it to the list

fn list(&self) -> &[u64][src]

Return all primes found so far as a slice

Auto Trait Implementations

impl RefUnwindSafe for Sieve

impl Send for Sieve

impl Sync for Sieve

impl Unpin for Sieve

impl UnwindSafe for Sieve

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<P> PrimeSet for P where
    P: PrimeSetBasics

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.