Enum cursive::event::EventResult
[−]
[src]
pub enum EventResult {
Ignored,
Consumed(Option<Callback>),
}Answer to an event notification. The event can be consumed or ignored.
Variants
IgnoredThe event was ignored. The parent can keep handling it.
Consumed(Option<Callback>)The event was consumed. An optionnal callback to run is attached.
Methods
impl EventResult[src]
fn with_cb<F: 'static + Fn(&mut Cursive)>(f: F) -> Self[src]
Convenient method to create Consumed(Some(f))
fn is_consumed(&self) -> bool[src]
Returns true if self is EventResult::Consumed.
fn has_callback(&self) -> bool[src]
Returns true if self contains a callback.
fn process(self, s: &mut Cursive)[src]
Process this result if it is a callback.
Does nothing otherwise.
fn or_else<F>(self, f: F) -> Self where
F: FnOnce() -> EventResult, [src]
F: FnOnce() -> EventResult,
Returns self if it is not Event::Ignored, otherwise returns f().