pub trait CachedOperation<I, Q: QueueCapAtLeast<LEN, Item = I>, const LEN: usize> {
    type Output;

    // Required method
    fn call(&mut self, q: &Q, new_period: bool, x: &I) -> Self::Output;

    // Provided method
    fn share_with<P>(self, op: P) -> Shared<I, Self, P>
       where P: CachedOperation<I, Q, LEN>,
             Self: Sized { ... }
}
Expand description

Tumbling operations that apply on the cached inputs.

Required Associated Types§

source

type Output

The output type.

Required Methods§

source

fn call(&mut self, q: &Q, new_period: bool, x: &I) -> Self::Output

Call.

Provided Methods§

source

fn share_with<P>(self, op: P) -> Shared<I, Self, P>where P: CachedOperation<I, Q, LEN>, Self: Sized,

Share the cached queue with other cached operation.

Implementors§

source§

impl<F, I, O, Q: QueueCapAtLeast<LEN, Item = I>, const LEN: usize> CachedOperation<I, Q, LEN> for Fwhere F: FnMut(&Q, bool, &I) -> O,

§

type Output = O

source§

impl<I, Q: QueueCapAtLeast<LEN, Item = I>, K, P, const LEN: usize> CachedOperation<I, Q, LEN> for SharedMap<I, K, P>where K: Clone + Eq + Hash, P: CachedOperation<I, Q, LEN>,

§

type Output = HashMap<K, <P as CachedOperation<I, Q, LEN>>::Output>

source§

impl<I, Q: QueueCapAtLeast<LEN, Item = I>, P1, P2, const LEN: usize> CachedOperation<I, Q, LEN> for Shared<I, P1, P2>where P1: CachedOperation<I, Q, LEN>, P2: CachedOperation<I, Q, LEN>,

§

type Output = (<P1 as CachedOperation<I, Q, LEN>>::Output, <P2 as CachedOperation<I, Q, LEN>>::Output)