Enum cursive::event::EventResult [−][src]
Answer to an event notification. The event can be consumed or ignored.
Variants
Ignored
The 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]
impl EventResult
pub fn with_cb<F>(f: F) -> Self where
F: 'static + Fn(&mut Cursive),
[src]
pub fn with_cb<F>(f: F) -> Self where
F: 'static + Fn(&mut Cursive),
Convenient method to create Consumed(Some(f))
pub fn is_consumed(&self) -> bool
[src]
pub fn is_consumed(&self) -> bool
Returns true
if self
is EventResult::Consumed
.
pub fn has_callback(&self) -> bool
[src]
pub fn has_callback(&self) -> bool
Returns true
if self
contains a callback.
pub fn process(self, s: &mut Cursive)
[src]
pub fn process(self, s: &mut Cursive)
Process this result if it is a callback.
Does nothing otherwise.
pub fn or_else<F>(self, f: F) -> Self where
F: FnOnce() -> EventResult,
[src]
pub fn or_else<F>(self, f: F) -> Self where
F: FnOnce() -> EventResult,
Returns self
if it is not EventResult::Ignored
, otherwise returns f()
.
Auto Trait Implementations
impl !Send for EventResult
impl !Send for EventResult
impl !Sync for EventResult
impl !Sync for EventResult