Trait differential_dataflow::difference::Diff
source · pub trait Diff: Add<Self, Output = Self> + Sub<Self, Output = Self> + Neg<Output = Self> + Sized + Data + Copy {
fn is_zero(&self) -> bool;
fn zero() -> Self;
}Expand description
A type that can be treated as a difference.
The mathematical requirements are, I believe, an Abelian group, in that we require addition, inverses, and almost certainly use commutativity somewhere (it isn’t clear if it is a requirement, as it isn’t clear that there are semantics other than “we accumulate your differences”; I suspect we don’t always accumulate them in the right order, so commutativity is important until we conclude otherwise).