TimelyDataflow / differential-dataflow

An implementation of differential dataflow using timely dataflow on Rust.
MIT License
2.53k stars 182 forks source link

Further trait reorganization #427

Closed frankmcsherry closed 9 months ago

frankmcsherry commented 9 months ago

This PR moves BatchContainer and OrdOffset out of the layers module which is specific to Trie implementations, and in to the implementations module, which seems more appropriate.

It also experiments a bit with the BatchContainer trait, allowing Item to be unsized, and supporting push and copy_slice only when T: ToOwned. This is .. unfortunately a restriction rather than a pure generalization; to implement ToOwned you have to be able to clone yourself, even though we don't need this.

Up for discussion, but I think based on the vibes around containers, and their non-ownership-providing nature, this might be ok.

cc: @antiguru

frankmcsherry commented 9 months ago

Oh oops, it also adds a SliceContainer which shows off the new BatchContainer by having an Item = [B] but accepting Vec<B> in push and copy_slice, and storing only one Vec<B> and a whole bunch of offsets into it (as many as you introduce, plus one).