[][src]Enum cursive::event::EventResult

pub enum EventResult {
    Ignored,
    Consumed(Option<Callback>),
}

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.

Implementations

impl EventResult[src]

pub fn with_cb<F>(f: F) -> EventResult where
    F: 'static + Fn(&mut Cursive), 
[src]

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]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[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]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> With for T[src]