[][src]Enum euca::vdom::EventHandler

pub enum EventHandler<'a, Message> {
    Msg(&'a Message),
    Fn(fn(_: Event) -> Option<Message>),
    FnMsg(&'a Message, fn(_: Message, _: Event) -> Option<Message>),
    InputValue(fn(_: String) -> Option<Message>),
    InputEvent(fn(_: InputEvent) -> Option<Message>),
}

This represents an event handler. The handler can either always map to a specific message, or a function can be provided that will transform the given web_sys::Event into a message. This function must be a plain fn pointer and cannot capture any state from the environment.

Variants

Msg(&'a Message)

A message that will be generated when this event associated with this handler fires.

Fn(fn(_: Event) -> Option<Message>)

A callback that will convert a web_sys::Event into a message.

FnMsg(&'a Message, fn(_: Message, _: Event) -> Option<Message>)

A callback that will convert a web_sys::Event into a message.

This variation accepts a message to pass data into the callback.

InputValue(fn(_: String) -> Option<Message>)

This callback will recieve the value of a form input and convert it to a message.

InputEvent(fn(_: InputEvent) -> Option<Message>)

A function that will convert a web_sys::InputEvent event to a Message.

Trait Implementations

impl<'a, Message: Clone> Clone for EventHandler<'a, Message>[src]

impl<'a, Message: Copy> Copy for EventHandler<'a, Message>[src]

impl<'a, Message: Debug> Debug for EventHandler<'a, Message>[src]

impl<'a, Message: PartialEq> PartialEq<EventHandler<'a, Message>> for EventHandler<'a, Message>[src]

impl<'a, Message> StructuralPartialEq for EventHandler<'a, Message>[src]

Auto Trait Implementations

impl<'a, Message> RefUnwindSafe for EventHandler<'a, Message> where
    Message: RefUnwindSafe

impl<'a, Message> Send for EventHandler<'a, Message> where
    Message: Sync

impl<'a, Message> Sync for EventHandler<'a, Message> where
    Message: Sync

impl<'a, Message> Unpin for EventHandler<'a, Message>

impl<'a, Message> UnwindSafe for EventHandler<'a, Message> where
    Message: RefUnwindSafe

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> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<M> Update<(), ()> for M[src]