[][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.

Methods

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
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<P> PrimeSet for P where
    P: PrimeSetBasics
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.