Trait InputSelector

Source
pub trait InputSelector: PartialEq {
    type Input: 'static + Eq + Hash;

    // Required method
    fn select(states: &BounceStates, input: Rc<Self::Input>) -> Rc<Self>;
}
Expand description

An auto-updating derived state, similar to Selector, but with an input.

Each selector with a different input are treated as a different selector.

It will automatically update when any selected state changes and only notifies registered hooks when prev_value != next_value.

Required Associated Types§

Source

type Input: 'static + Eq + Hash

The input type of the current input selector.

Required Methods§

Source

fn select(states: &BounceStates, input: Rc<Self::Input>) -> Rc<Self>

Selects self from existing bounce states with an input.

§Panics

states.get_selector_value::<T>() will panic if you are trying to create a loop by selecting current selector again.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§