[−][src]Trait differential_dataflow::difference::Monoid
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).
Required methods
fn zero() -> Self
The additive identity.
This method is primarily used by differential dataflow internals as part of consolidation, when one value is accumulated elsewhere and must be replaced by valid but harmless value.
Provided methods
fn is_zero(&self) -> bool
Returns true if the element is the additive identity.
This is primarily used by differential dataflow to know when it is safe to delete an update. When a difference accumulates to zero, the difference has no effect on any accumulation and can be removed.