[−][src]Enum cursive::event::EventResult
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]
pub fn with_cb<F>(f: F) -> Self where
F: 'static + Fn(&mut Cursive),
[src]
F: 'static + Fn(&mut Cursive),
Convenient method to create Consumed(Some(f))
pub fn is_consumed(&self) -> bool
[src]
Returns true
if self
is EventResult::Consumed
.
pub fn has_callback(&self) -> bool
[src]
Returns true
if self
contains a callback.
pub fn process(self, s: &mut Cursive)
[src]
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]
F: FnOnce() -> EventResult,
Returns self
if it is not EventResult::Ignored
, otherwise returns f()
.
pub fn and(self, other: Self) -> Self
[src]
Returns an event result that combines self
and other
.
Auto Trait Implementations
impl Unpin for EventResult
impl !Sync for EventResult
impl !Send for EventResult
impl !UnwindSafe for EventResult
impl !RefUnwindSafe for EventResult
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,