TimelyDataflow / differential-dataflow

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

Introduce and integrate `IntoOwned` trait #495

Closed frankmcsherry closed 1 month ago

frankmcsherry commented 1 month ago

This PR rebrands MyTrait<'a> as IntoOwned<'a>, an analogue of ToOwned that is more GAT-friendly. GATs can implement IntoOwned<'_> and support the re-borrowing of the owned type back into the GAT. The existing ToOwned infrastructure relies instead on Rust's Borrow, which can only borrow into a reference to a Borrowed type.

The PR also streamlines MyTrait, removing comparison functionality from it. The inequalities were unused, and the equality method can be locally implemented using borrow_as, as our implementors all support co-variant PartialOrd implementations.

Some other light changes around removing the push functionality for BatchContainer preceded this work (pointed out that the remaining complexity was MyTrait), but I think we agree that these changes are good too.

Only known regression is in rhh.rs, where previously we supported a non-allocating hash evaluation, but now call into_owned(). We can shake that out once things are more stable and rhh is actually expected to work.

frankmcsherry commented 1 month ago

Thank you!