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

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 optional callback to run is attached.

Implementations§

Convenient method to create Consumed(Some(f))

Convenient method to create Consumed(Some(f))

After being called once, the callback will become a no-op.

Convenient method to create Consumed(None)

Returns true if self is EventResult::Consumed.

Returns true if self contains a callback.

Process this result if it is a callback.

Does nothing otherwise.

Returns self if it is not EventResult::Ignored, otherwise returns f().

Returns an event result that combines self and other.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.