Skip to main content

DecisionSpecification

Trait DecisionSpecification 

Source
pub trait DecisionSpecification<T: ?Sized> {
    type Decision;

    // Required method
    fn decide(&self, candidate: &T) -> Option<&Self::Decision>;
}
Expand description

A rule that selects a typed decision for a candidate.

Required Associated Types§

Source

type Decision

The decision selected by this rule.

Required Methods§

Source

fn decide(&self, candidate: &T) -> Option<&Self::Decision>

Returns the selected decision, or None when no rule matches.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T: ?Sized, Decision> DecisionSpecification<T> for FirstMatch<T, Decision>

Source§

type Decision = Decision

Source§

impl<T: ?Sized, Decision> DecisionSpecification<T> for IndexedFirstMatch<T, Decision>

Source§

type Decision = Decision