pub fn run_action<T>(&self, event: &T) -> Option<R>
        where E: Borrow<T>, T: Hash + Eq + ?Sized
    {
        self.get_action(event).and_then(|action| Some(action()))
    }
/// Given an event that is in the bindings, run the
/// corresponding action and return the result.  Return
/// `None` if no such event is bound.
///
/// # Examples:
///
/// ```
/// use kbehdz::{Action, Bindings};
/// let aok: Action<String> = &|| {
///     "aok".to_string()
/// };
/// let bindings = &[("a", aok)];
/// let mut kc: Bindings<String, String> =
///     bindings.iter().collect();
/// assert_eq!(kc.run_action("a").unwrap(), "aok");
/// ```
Given an event that is in the bindings, run the
corresponding action and return the result.  Return
`None` if no such event is bound.
Given an event that is in the bindings run the corresponding action and return the result . Return ` None ` if no such event is bound .
pub fn run_action<T>(&self, event: &T) -> Option<R>
        where E: Borrow<T>, T: Hash + Eq + ?Sized
    {
        self.get_action(event).and_then(|action| Some(action()))
    }
pub fn run_action < T > ( & self , event : & T ) -> Option < R > where E : Borrow < T > , T : Hash + Eq + ? Sized { self . get_action ( event ) . and_then ( | action | Some ( action ( ) ) ) }
Given an event that is in the bindings, run the
corresponding action and return the result.
Given an event that is in the bindings run the corresponding action and return the result .
&self
event
&T
&self
event
&T
examples:
```
use kbehdz::{Action, Bindings};
let aok: Action = &|| {
"aok".to_string()
};
let bindings = &[("a", aok)];
let mut kc: Bindings
bindings.iter().collect();
assert_eq!(kc.run_action("a").unwrap(), "aok");
```
` ` ` use kbehdz :: { Action Bindings } ; let aok : Action = &|| { " aok " . to_string () } ; let bindings = & [ ( " a " aok ) ] ; let mut kc : Bindings bindings . iter () . collect () ; assert_eq! ( kc . run_action ( " a " ) . unwrap () " aok " ) ; ` ` `