Enum cursive::event::EventResult [−][src]
Answer to an event notification. The event can be consumed or ignored.
Variants
The event was ignored. The parent can keep handling it.
The event was consumed. An optionnal callback to run is attached.
Implementations
impl EventResult
[src]
pub fn with_cb<F>(f: F) -> EventResult 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) -> EventResult where
F: FnOnce() -> EventResult,
[src]
F: FnOnce() -> EventResult,
Returns self
if it is not EventResult::Ignored
, otherwise returns f()
.
pub fn and(self, other: EventResult) -> EventResult
[src]
Returns an event result that combines self
and other
.
Auto Trait Implementations
impl !RefUnwindSafe for EventResult
[src]
impl !Send for EventResult
[src]
impl !Sync for EventResult
[src]
impl Unpin for EventResult
[src]
impl !UnwindSafe for EventResult
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
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.
pub 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.