Skip to main content

ValueSelector

Trait ValueSelector 

Source
pub trait ValueSelector<S: PlanningSolution, V>: Send + Debug {
    // Required methods
    fn iter<'a, D: Director<S>>(
        &'a self,
        score_director: &D,
        descriptor_index: usize,
        entity_index: usize,
    ) -> impl Iterator<Item = V> + 'a;
    fn size<D: Director<S>>(
        &self,
        score_director: &D,
        descriptor_index: usize,
        entity_index: usize,
    ) -> usize;

    // Provided method
    fn is_never_ending(&self) -> bool { ... }
}
Expand description

A value selector that yields values of type V directly.

Unlike ValueSelector which returns Arc<dyn Any>, this trait returns V inline, eliminating heap allocation per value.

§Type Parameters

  • S - The planning solution type
  • V - The value type

Required Methods§

Source

fn iter<'a, D: Director<S>>( &'a self, score_director: &D, descriptor_index: usize, entity_index: usize, ) -> impl Iterator<Item = V> + 'a

Source

fn size<D: Director<S>>( &self, score_director: &D, descriptor_index: usize, entity_index: usize, ) -> usize

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<S> ValueSelector<S, usize> for RangeValueSelector<S>

Source§

impl<S, V> ValueSelector<S, V> for FromSolutionValueSelector<S, V>
where S: PlanningSolution, V: Clone + Send + Debug + 'static,

Source§

impl<S, V> ValueSelector<S, V> for PerEntitySliceValueSelector<S, V>
where S: PlanningSolution, V: Copy + Send + Debug + 'static,

Source§

impl<S, V> ValueSelector<S, V> for PerEntityValueSelector<S, V>
where S: PlanningSolution, V: Clone + Send + Debug + 'static,

Source§

impl<S, V> ValueSelector<S, V> for StaticValueSelector<S, V>
where S: PlanningSolution, V: Clone + Send + Debug + 'static,