pub fn insert_action_binding<B: IntoIterator<Item = Button>>(
        &mut self,
        id: T::Action,
        binding: B,
    ) -> Result<(), BindingError<T>> {
        let bind: SmallVec<[Button; 2]> = binding.into_iter().collect();
        self.check_action_invariants(&id, bind.as_slice())?;
        let mut make_new = false;
        match self.actions.get_mut(&id) {
            Some(action_bindings) => {
                action_bindings.push(bind.clone());
            }
            None => {
                make_new = true;
            }
        }
        if make_new {
            let mut bindings = SmallVec::new();
            bindings.push(bind);
            self.actions.insert(id, bindings);
        }
        Ok(())
    }
/// Add a button or button combination to an action.
///
/// This will attempt to insert a new binding between this action and the button(s).
Add a button or button combination to an action.
This will attempt to insert a new binding between this action and the button(s).
Add a button or button combination to an action . This will attempt to insert a new binding between this action and the button ( s ) .
pub fn insert_action_binding<B: IntoIterator<Item = Button>>(
        &mut self,
        id: T::Action,
        binding: B,
    ) -> Result<(), BindingError<T>> {
        let bind: SmallVec<[Button; 2]> = binding.into_iter().collect();
        self.check_action_invariants(&id, bind.as_slice())?;
        let mut make_new = false;
        match self.actions.get_mut(&id) {
            Some(action_bindings) => {
                action_bindings.push(bind.clone());
            }
            None => {
                make_new = true;
            }
        }
        if make_new {
            let mut bindings = SmallVec::new();
            bindings.push(bind);
            self.actions.insert(id, bindings);
        }
        Ok(())
    }
pub fn insert_action_binding < B : IntoIterator < Item = Button > > ( & mut self , id : T :: Action , binding : B , ) -> Result < ( ) , BindingError < T > > { let bind : SmallVec < [ Button ; 2 ] > = binding . into_iter ( ) . collect ( ) ; self . check_action_invariants ( & id , bind . as_slice ( ) ) ? ; let mut make_new = false ; match self . actions . get_mut ( & id ) { Some ( action_bindings ) => { action_bindings . push ( bind . clone ( ) ) ; } None => { make_new = true ; } } if make_new { let mut bindings = SmallVec :: new ( ) ; bindings . push ( bind ) ; self . actions . insert ( id , bindings ) ; } Ok ( ( ) ) }
Add a button or button combination to an action.
Add a button or button combination to an action .
&mut self
id
T::Action
binding
B