Trait differential_dataflow::difference::IsZero
source · pub trait IsZero {
// Required method
fn is_zero(&self) -> bool;
}
Expand description
A type that can be an additive identity for all Semigroup
implementations.
This method is extracted from Semigroup
to avoid ambiguity when used.
It refers exclusively to the type itself, and whether it will act as the identity
in the course of Semigroup<Self>::plus_equals()
.
Required Methods§
sourcefn is_zero(&self) -> bool
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.
A semigroup is not obligated to have a zero element, and this method could always return false in such a setting.