differential_dataflow::operators::negate

Trait Negate

Source
pub trait Negate<G, C> {
    // Required method
    fn negate(&self) -> Self;
}
Expand description

Negate the contents of a stream.

Required Methods§

Source

fn negate(&self) -> Self

Creates a new collection whose counts are the negation of those in the input.

This method is most commonly used with concat to get those element in one collection but not another. However, differential dataflow computations are still defined for all values of the difference type R, including negative counts.

§Examples
use differential_dataflow::input::Input;

::timely::example(|scope| {

    let data = scope.new_collection_from(1 .. 10).1;

    let odds = data.filter(|x| x % 2 == 1);
    let evens = data.filter(|x| x % 2 == 0);

    odds.negate()
        .concat(&data)
        .assert_eq(&evens);
});

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<G: Scope, D: Data, T: Data, R: Data + Abelian> Negate<G, Vec<(D, T, R)>> for Stream<G, (D, T, R)>

Source§

fn negate(&self) -> Self

Implementors§

Source§

impl<G, D, R, C> Negate<G, C> for Collection<G, D, R, C>
where G: Scope, C: Clone, StreamCore<G, C>: Negate<G, C>,