pub trait RayonPoolSpawner: Spawner + Metrics {
// Required method
fn create_pool(
&self,
concurrency: NonZeroUsize,
) -> Result<ThreadPool, ThreadPoolBuildError>;
// Provided method
fn create_strategy(
&self,
concurrency: NonZeroUsize,
) -> Result<Rayon, ThreadPoolBuildError> { ... }
}Expand description
Required Methods§
Sourcefn create_pool(
&self,
concurrency: NonZeroUsize,
) -> Result<ThreadPool, ThreadPoolBuildError>
fn create_pool( &self, concurrency: NonZeroUsize, ) -> Result<ThreadPool, ThreadPoolBuildError>
Creates a clone-able rayon-compatible thread pool with Spawner::spawn.
§Arguments
concurrency: The number of tasks to execute concurrently in the pool.
§Returns
A Result containing the configured rayon::ThreadPool or a rayon::ThreadPoolBuildError if the pool cannot
be built.
Provided Methods§
Sourcefn create_strategy(
&self,
concurrency: NonZeroUsize,
) -> Result<Rayon, ThreadPoolBuildError>
fn create_strategy( &self, concurrency: NonZeroUsize, ) -> Result<Rayon, ThreadPoolBuildError>
Creates a clone-able Rayon strategy for use with commonware_parallel.
§Arguments
concurrency: The number of tasks to execute concurrently in the pool.
§Returns
A Result containing the configured Rayon strategy or a rayon::ThreadPoolBuildError if the pool cannot be
built.
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.