Skip to main content

PyBitGeneratorMethods

Trait PyBitGeneratorMethods 

Source
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§

Source

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§

Source

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".

Implementations on Foreign Types§

Source§

impl<'py> PyBitGeneratorMethods for Bound<'py, PyBitGenerator>

Source§

fn spawn(&self, n_children: usize) -> PyResult<Vec<BitGenerator>>

Implementors§