differential_dataflow/columnar/
layout.rs1use std::fmt::Debug;
7use columnar::Columnar;
8use crate::trace::implementations::{Layout, OffsetList};
9use crate::difference::Semigroup;
10use crate::lattice::Lattice;
11use timely::progress::Timestamp;
12
13pub struct ColumnarLayout<U: ColumnarUpdate> {
15 phantom: std::marker::PhantomData<U>,
16}
17
18impl<K, V, T, R> ColumnarUpdate for (K, V, T, R)
19where
20 K: Columnar<Container: OrdContainer + Debug + Default> + Debug + Ord + Clone + 'static,
21 V: Columnar<Container: OrdContainer + Debug + Default> + Debug + Ord + Clone + 'static,
22 T: Columnar<Container: OrdContainer + Debug + Default> + Debug + Ord + Default + Clone + Lattice + Timestamp,
23 R: Columnar<Container: OrdContainer + Debug + Default> + Debug + Ord + Default + Semigroup + 'static,
24{
25 type Key = K;
26 type Val = V;
27 type Time = T;
28 type Diff = R;
29}
30
31impl<U: ColumnarUpdate> Layout for ColumnarLayout<U> {
32 type KeyContainer = super::arrangement::Coltainer<U::Key>;
33 type ValContainer = super::arrangement::Coltainer<U::Val>;
34 type TimeContainer = super::arrangement::Coltainer<U::Time>;
35 type DiffContainer = super::arrangement::Coltainer<U::Diff>;
36 type OffsetContainer = OffsetList;
37}
38
39pub trait ColumnarUpdate : Debug + 'static {
43 type Key: Columnar<Container: OrdContainer + Debug + Default> + Debug + Ord + Clone + 'static;
45 type Val: Columnar<Container: OrdContainer + Debug + Default> + Debug + Ord + Clone + 'static;
47 type Time: Columnar<Container: OrdContainer + Debug + Default> + Debug + Ord + Default + Clone + Lattice + Timestamp;
49 type Diff: Columnar<Container: OrdContainer + Debug + Default> + Debug + Ord + Default + Semigroup + 'static;
51}
52
53pub trait OrdContainer : for<'a> columnar::Container<Ref<'a> : Ord> { }
55impl<C: for<'a> columnar::Container<Ref<'a> : Ord>> OrdContainer for C { }