[][src]Struct actyxos_data_flow::flow::Grouped

pub struct Grouped<'a, K, V>(_, _)
where
    K: ExchangeData + Hashable,
    V: ExchangeData
;

An arrangement of a collection by key

The collection is partitioned by key and stored in-memory so that it can be manipulated

Implementations

impl<'a, K, V> Grouped<'a, K, V> where
    K: ExchangeData + Hashable,
    V: ExchangeData
[src]

pub fn join<V2, L, D, I>(
    &self,
    other: &Grouped<'a, K, V2>,
    f: L
) -> Flow<'a, D, Stateful> where
    V2: ExchangeData,
    D: ExchangeData,
    I: IntoIterator<Item = D>,
    L: FnMut(&K, &V, &V2) -> I + 'static, 
[src]

Join this collection with another that uses the same key, combining values with the given 1:many function

pub fn join_single<V2, L, D>(
    &self,
    other: &Grouped<'a, K, V2>,
    f: L
) -> Flow<'a, D, Stateful> where
    V2: ExchangeData,
    D: ExchangeData,
    L: FnMut(&K, &V, &V2) -> D + 'static, 
[src]

Join this collection with another that uses the same key, combining values with the given 1:1 function

pub fn reduce<V2, L>(&self, f: L) -> Grouped<'a, K, V2> where
    V2: ExchangeData,
    L: FnMut(&K, &[(&V, isize)], &mut Vec<(V2, isize)>) + 'static, 
[src]

Reduce each per-key collection to a vector of output values

pub fn threshold(&self, f: impl FnMut(&K, &V, isize) -> isize + 'static) -> Self[src]

Transform the multiplicity of each collection element

pub fn distinct(&self) -> Self[src]

Set the multiplicity of each collection element to 1

pub fn count(&self) -> Grouped<'a, K, isize>[src]

Count the number of elements per key

pub fn min(&self) -> Self[src]

Compute the minimum element per key

pub fn max(&self) -> Self[src]

Compute the maximum element per key

pub fn max_by<T, F>(&self, f: F) -> Self where
    F: Fn(&V) -> T + 'static + Clone,
    T: Ord
[src]

Compute the maximum element per key, sorting by the result of applying the given function to each value

pub fn ungroup(&self) -> Flow<'a, V, Stateful>[src]

Ungroup by discarding the key

pub fn ungroup_with<T: ExchangeData>(
    &self,
    f: impl FnMut(&K, &V) -> T + 'static
) -> Flow<'a, T, Stateful>
[src]

Ungroup by computing the new element from key and value

pub fn ungroup_both(&self) -> Flow<'a, (K, V), Stateful>[src]

Ungroup to a collection of key-value pairs

pub fn regroup<K2, V2, L>(&self, f: L) -> Grouped<'a, K2, V2> where
    K2: ExchangeData + Hashable,
    V2: ExchangeData,
    L: FnMut(&K, &V) -> (K2, V2) + 'static, 
[src]

Rearrange this collection by a different key

Auto Trait Implementations

impl<'a, K, V> !RefUnwindSafe for Grouped<'a, K, V>

impl<'a, K, V> !Send for Grouped<'a, K, V>

impl<'a, K, V> !Sync for Grouped<'a, K, V>

impl<'a, K, V> Unpin for Grouped<'a, K, V> where
    K: Unpin,
    V: Unpin

impl<'a, K, V> !UnwindSafe for Grouped<'a, K, V>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<Src, Dst> LosslessTryInto<Dst> for Src where
    Dst: LosslessTryFrom<Src>, 
[src]

impl<Src, Dst> LossyInto<Dst> for Src where
    Dst: LossyFrom<Src>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,