Trait differential_dataflow::difference::Semigroup
source · pub trait Semigroup<Rhs: ?Sized = Self>: Clone + IsZero {
// Required method
fn plus_equals(&mut self, rhs: &Rhs);
}
Expand description
A type with addition and a test for zero.
These traits are currently the minimal requirements for a type to be a “difference” in differential dataflow. Addition allows differential dataflow to compact multiple updates to the same data, and the test for zero allows differential dataflow to retire updates that have no effect. There is no requirement that the test for zero ever return true, and the zero value does not need to inhabit the type.
There is a light presumption of commutativity here, in that while we will largely perform addition in order of timestamps, for many types of timestamps there is no total order and consequently no obvious order to respect. Non-commutative semigroups should be used with care.
Required Methods§
sourcefn plus_equals(&mut self, rhs: &Rhs)
fn plus_equals(&mut self, rhs: &Rhs)
The method of std::ops::AddAssign
, for types that do not implement AddAssign
.