Trait SieveFactory

Source
pub trait SieveFactory {
    type Item;
    type Sieve: Iterator<Item = Self::Item>;

    // Required method
    fn make_sieve(
        &mut self,
        rng: &mut (impl CryptoRngCore + ?Sized),
        previous_sieve: Option<&Self::Sieve>,
    ) -> Option<Self::Sieve>;
}
Expand description

A type producing sieves for random prime generation.

Required Associated Types§

Source

type Item

The type of items returning by the sieves.

Source

type Sieve: Iterator<Item = Self::Item>

The resulting sieve.

Required Methods§

Source

fn make_sieve( &mut self, rng: &mut (impl CryptoRngCore + ?Sized), previous_sieve: Option<&Self::Sieve>, ) -> Option<Self::Sieve>

Makes a sieve given an RNG and the previous exhausted sieve (if any).

Returning None signals that the prime generation should stop.

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.

Implementors§