Trait kgdata::mapreduce::ParallelDataset
source · pub trait ParallelDataset: Sized + Send + IntoParallelIterator {
// Provided methods
fn map<F, R>(self, op: F) -> MapOp<Self, F>
where F: Fn(Self::Item) -> R + Sync + Send,
R: Send { ... }
fn flat_map<F, R>(self, op: F) -> FlatMapOp<Self, F>
where F: Fn(Self::Item) -> R + Sync + Send,
R: IntoParallelIterator { ... }
fn filter<F>(self, op: F) -> FilterOp<Self, F>
where F: Fn(&Self::Item) -> bool + Sync { ... }
fn fold<T, ID, F>(self, identity: ID, op: F) -> FoldOp<Self, ID, F>
where F: Fn(T, Self::Item) -> T + Sync + Send,
ID: Fn() -> T + Sync + Send,
T: Send { ... }
fn reduce<ID, F>(self, identity: ID, op: F) -> Self::Item
where F: Fn(Self::Item, Self::Item) -> Self::Item + Sync + Send,
ID: Fn() -> Self::Item + Sync + Send { ... }
fn sort_by_key<F, K>(self, op: F, ascending: bool) -> SortByKeyOp<Self, F>
where F: Fn(&Self::Item) -> K + Sync,
K: Ord + Send { ... }
fn group_by<F, K>(self, key: F) -> MapDataset<K, Vec<Self::Item>>
where F: Fn(&Self::Item) -> K + Sync,
K: Hash + Eq + Send { ... }
fn group_by_map<K, V, F1, F2>(
self,
key: F1,
value: F2
) -> MapDataset<K, Vec<V>>
where F1: Fn(&Self::Item) -> K + Sync,
F2: Fn(&Self::Item) -> V + Sync,
K: Hash + Eq + Send,
V: Send { ... }
fn count(self) -> usize { ... }
fn take_any(self, n: usize) -> TakeAny<Self> { ... }
fn collect<C>(self) -> C
where C: FromParallelDataset<Self::Item> { ... }
}
Expand description
A note on the implementation: due to the trait methods required Sized on most of the methods, if we use as trait object, we can’t use most of its methods. To prevent early boxing error, we required it to be Sized.
Provided Methods§
fn map<F, R>(self, op: F) -> MapOp<Self, F>
fn flat_map<F, R>(self, op: F) -> FlatMapOp<Self, F>
fn filter<F>(self, op: F) -> FilterOp<Self, F>
fn fold<T, ID, F>(self, identity: ID, op: F) -> FoldOp<Self, ID, F>
fn reduce<ID, F>(self, identity: ID, op: F) -> Self::Item
fn sort_by_key<F, K>(self, op: F, ascending: bool) -> SortByKeyOp<Self, F>
fn group_by<F, K>(self, key: F) -> MapDataset<K, Vec<Self::Item>>
fn group_by_map<K, V, F1, F2>(self, key: F1, value: F2) -> MapDataset<K, Vec<V>>
fn count(self) -> usize
fn take_any(self, n: usize) -> TakeAny<Self>
fn collect<C>(self) -> Cwhere
C: FromParallelDataset<Self::Item>,
Object Safety§
This trait is not object safe.