Skip to main content

ValidIdempotenceFor

Trait ValidIdempotenceFor 

Source
pub trait ValidIdempotenceFor<R: Retries>: Sealed<R> { }
Expand description

Marker trait identifying that the idempotence property is valid for the given stream ordering.

Definition (aggregations, |acc: &mut A, item: T|): for any accumulator value and any item x, applying the closure with x twice in a row must produce the same final accumulator as applying it once. For reduce, whose accumulator is seeded with the first element, applying the closure to an accumulator equal to x with the item x must also leave the accumulator equal to x. On unordered streams, combined with commutativity, this makes the final aggregate independent of duplicates at any position. Definition (for_each, |item: T|): processing an item twice in a row must leave the mutably-captured state in the same final value as processing it once.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§