MonadicCausableCollection

Trait MonadicCausableCollection 

Source
pub trait MonadicCausableCollection<I, O, T>: CausableCollectionAccessor<I, O, T>
where T: MonadicCausable<I, O> + Causable, O: Aggregatable + Clone + Default + Send + Sync + 'static + Debug,
{ // Provided method fn evaluate_collection( &self, incoming_effect: &PropagatingEffect<I>, logic: &AggregateLogic, threshold_value: Option<NumericalValue>, ) -> PropagatingEffect<O> { ... } }

Provided Methods§

Source

fn evaluate_collection( &self, incoming_effect: &PropagatingEffect<I>, logic: &AggregateLogic, threshold_value: Option<NumericalValue>, ) -> PropagatingEffect<O>

Evaluates a collection of MonadicCausable items, aggregating their monadic effects.

This method provides a single, unified entry point for reasoning over a collection of causable items. It monadically evaluates each item and then uses a type-aware aggregation strategy to combine the results.

§Arguments
  • incoming_effect - A PropagatingEffect to be passed to each MonadicCausable item.
  • logic - The AggregateLogic (e.g., All, Any, None, Some(k)) that defines how the results are combined.
  • threshold_value - An optional NumericalValue used for comparisons (e.g., converting a probability to a boolean). It is required for some aggregation strategies.
§Returns

A PropagatingEffect representing the aggregated monadic effect of the collection.

§Errors

Returns a PropagatingEffect containing a CausalityError if:

  • The collection is empty.
  • An item’s evaluate method returns an error.

Implementations on Foreign Types§

Source§

impl<I, O, K, V> MonadicCausableCollection<I, O, V> for BTreeMap<K, V>
where K: Ord, V: MonadicCausable<I, O> + Causable + Clone, O: Aggregatable + Clone + Default + Send + Sync + 'static + Debug,

Source§

impl<I, O, K, V> MonadicCausableCollection<I, O, V> for HashMap<K, V>
where K: Eq + Hash, V: MonadicCausable<I, O> + Causable + Clone, O: Aggregatable + Clone + Default + Send + Sync + 'static + Debug,

Source§

impl<I, O, T> MonadicCausableCollection<I, O, T> for [T]
where T: MonadicCausable<I, O> + Clone + Causable, O: Aggregatable + Clone + Default + Send + Sync + 'static + Debug,

Source§

impl<I, O, T> MonadicCausableCollection<I, O, T> for VecDeque<T>
where T: MonadicCausable<I, O> + Causable + Clone, O: Aggregatable + Clone + Default + Send + Sync + 'static + Debug,

Implementors§