[][src]Struct cursive::event::EventTrigger

pub struct EventTrigger(_);

A trigger that only selects some types of events.

Methods

impl EventTrigger[src]

pub fn from_fn<F>(f: F) -> Self where
    F: 'static + Fn(&Event) -> bool
[src]

Create a new EventTrigger using the given function as filter.

pub fn apply(&self, event: &Event) -> bool[src]

Checks if this trigger applies to the given Event.

pub fn arrows() -> Self[src]

Returns an EventTrigger that only accepts arrow keys.

Only bare arrow keys without modifiers (Shift, Ctrl, Alt) will be accepted.

pub fn mouse() -> Self[src]

Returns an EventTrigger that only accepts mouse events.

pub fn any() -> Self[src]

Returns an EventTrigger that accepts any event.

pub fn none() -> Self[src]

Returns an EventTrigger that doesn't accept any event.

pub fn or<O>(self, other: O) -> Self where
    O: Into<EventTrigger>, 
[src]

Returns an EventTrigger that applies if either self or other applies.

Trait Implementations

impl From<Event> for EventTrigger[src]

impl From<char> for EventTrigger[src]

impl From<Key> for EventTrigger[src]

impl<F> From<F> for EventTrigger where
    F: 'static + Fn(&Event) -> bool
[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> Erased for T[src]