pub trait TypedReducer: Send + Sync {
type Value: Serialize + DeserializeOwned + Send + Sync;
// Required method
fn reduce(&self, current: Self::Value, incoming: Self::Value) -> Self::Value;
}Available on crate feature
graph only.Expand description
Trait for defining custom merge strategies for state values.
Implementations define how two values of the same type should be combined when parallel tasks produce outputs for the same state key, or when state updates need to be merged.
§Type Bounds
The associated Value type must be serializable, deserializable, and
thread-safe (Send + Sync).
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".