subspace_farmer::utils

Function rayon_custom_spawn_handler

source
pub fn rayon_custom_spawn_handler<SpawnHandlerBuilder, SpawnHandler, SpawnHandlerResult>(
    spawn_handler_builder: SpawnHandlerBuilder,
) -> impl FnMut(ThreadBuilder) -> Result<()>
where SpawnHandlerBuilder: FnMut(ThreadBuilder) -> SpawnHandler + Clone, SpawnHandler: FnOnce() -> SpawnHandlerResult + Send + 'static, SpawnHandlerResult: Send + 'static,
Expand description

This function is supposed to be used with [rayon::ThreadPoolBuilder::spawn_handler()] to spawn handler with a custom logic defined by spawn_hook_builder.

spawn_hook_builder is called with thread builder to create spawn_handler that in turn will be spawn rayon’s thread with desired environment.