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§
Required Methods§
Sourcefn make_sieve(
&mut self,
rng: &mut (impl CryptoRngCore + ?Sized),
previous_sieve: Option<&Self::Sieve>,
) -> Option<Self::Sieve>
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.