MapReduce

Struct MapReduce 

Source
pub struct MapReduce<T, M, R>
where M: Fn(&T) -> T, R: Fn(T, T) -> T,
{ /* private fields */ }
Expand description

Parallel map-reduce pipeline

Implementations§

Source§

impl<T, M, R> MapReduce<T, M, R>
where T: Send + Sync + Clone + 'static, M: Fn(&T) -> T + Send + Sync, R: Fn(T, T) -> T + Send + Sync,

Source

pub fn new(mapper: M, reducer: R) -> Self

Create a new map-reduce pipeline

Source

pub fn execute(&self, data: &[T]) -> Option<T>

Execute map-reduce on data

Auto Trait Implementations§

§

impl<T, M, R> Freeze for MapReduce<T, M, R>
where M: Freeze, R: Freeze,

§

impl<T, M, R> RefUnwindSafe for MapReduce<T, M, R>

§

impl<T, M, R> Send for MapReduce<T, M, R>
where M: Send, R: Send, T: Send,

§

impl<T, M, R> Sync for MapReduce<T, M, R>
where M: Sync, R: Sync, T: Sync,

§

impl<T, M, R> Unpin for MapReduce<T, M, R>
where M: Unpin, R: Unpin, T: Unpin,

§

impl<T, M, R> UnwindSafe for MapReduce<T, M, R>
where M: UnwindSafe, R: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.