pub fn maybe_serial<T, F>(self, f: F) -> T
        where
            T: Send,
            F: FnOnce() -> T + Send,
        { match self {
            Threading::Parallel => f(),
            Threading::Serial => {
                rayon::ThreadPoolBuilder::new()
                    .num_threads(1)
                    .build()
                    .unwrap()
                    .install(f)
            },
        }}
/// Runs a closure in an environment where rayon has possibly been modified
/// to run everything in serial.
///
/// The name is `maybe_serial` as opposed to `maybe_parallel` because the code
/// you write inside it should look like parallel code!
Runs a closure in an environment where rayon has possibly been modified
to run everything in serial.

The name is `maybe_serial` as opposed to `maybe_parallel` because the code
you write inside it should look like parallel code!
Runs a closure in an environment where rayon has possibly been modified to run everything in serial . The name is ` maybe_serial ` as opposed to ` maybe_parallel ` because the code you write inside it should look like parallel code!
pub fn maybe_serial<T, F>(self, f: F) -> T
        where
            T: Send,
            F: FnOnce() -> T + Send,
        { match self {
            Threading::Parallel => f(),
            Threading::Serial => {
                rayon::ThreadPoolBuilder::new()
                    .num_threads(1)
                    .build()
                    .unwrap()
                    .install(f)
            },
        }}
pub fn maybe_serial < T , F > ( self , f : F ) -> T where T : Send , F : FnOnce ( ) -> T + Send , { match self { Threading :: Parallel => f ( ) , Threading :: Serial => { rayon :: ThreadPoolBuilder :: new ( ) . num_threads ( 1 ) . build ( ) . unwrap ( ) . install ( f ) } , } }
Runs a closure in an environment where rayon has possibly been modified
to run everything in serial.
Runs a closure in an environment where rayon has possibly been modified to run everything in serial .
self
f
F
self
f
F