[][src]Trait differential_dataflow::difference::Monoid

pub trait Monoid: for<'a> AddAssign<&'a Self> + Sized + Data + Clone {
    fn zero() -> Self;

    fn is_zero(&self) -> bool { ... }
}

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.

Loading content...

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.

Loading content...

Implementations on Foreign Types

impl Monoid for isize[src]

fn is_zero(&self) -> bool[src]

impl Monoid for i64[src]

fn is_zero(&self) -> bool[src]

impl Monoid for i32[src]

fn is_zero(&self) -> bool[src]

Loading content...

Implementors

impl<R1: Monoid, R2: Monoid> Monoid for DiffPair<R1, R2>[src]

fn is_zero(&self) -> bool[src]

impl<R: Monoid> Monoid for DiffVector<R>[src]

Loading content...