Using

Trait Using 

Source
pub trait Using {
    type Item: Send + 'static;

    // Required methods
    fn create(&mut self, thread_idx: usize) -> Self::Item;
    fn into_inner(self) -> Self::Item;
}
Expand description

A type that can create a value per thread, which will then be send to the thread, and used mutable by the defined computation.

Required Associated Types§

Source

type Item: Send + 'static

Item to be used mutably by each threads used in parallel computation.

Required Methods§

Source

fn create(&mut self, thread_idx: usize) -> Self::Item

Creates an instance of the variable to be used by the thread_idx-th thread.

Source

fn into_inner(self) -> Self::Item

Consumes self and creates exactly one instance of the variable.

Implementors§

Source§

impl<F, T> Using for UsingFun<F, T>
where T: Send + 'static, F: FnMut(usize) -> T,

Source§

type Item = T

Source§

impl<T: Clone + Send + 'static> Using for UsingClone<T>

Source§

type Item = T