pub trait PyBitGeneratorMethods: Sealed {
// Required method
fn spawn(&self, n_children: usize) -> PyResult<Vec<BitGenerator>>;
// Provided method
fn spawn_one(&self) -> PyResult<BitGenerator> { ... }
}Expand description
Methods for PyBitGenerator.
Required Methods§
Sourcefn spawn(&self, n_children: usize) -> PyResult<Vec<BitGenerator>>
fn spawn(&self, n_children: usize) -> PyResult<Vec<BitGenerator>>
Spawn n_children independent child BitGenerators.
This is the way to obtain generators for multiple threads: each child has its own, independent state, so no synchronization is needed between them.
Provided Methods§
Sourcefn spawn_one(&self) -> PyResult<BitGenerator>
fn spawn_one(&self) -> PyResult<BitGenerator>
Spawn a single owned child BitGenerator.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".