pub enum Handler<Message> {
Msg(Message),
Event(fn(Event) -> Option<Message>),
MsgEvent(Message, fn(Message, Event) -> Option<Message>),
InputValue(fn(String) -> Option<Message>),
InputEvent(fn(InputEvent) -> Option<Message>),
}Expand description
A DOM event handler.
Variants§
Msg(Message)
The message that will result from the event this handler is attached to.
Event(fn(Event) -> Option<Message>)
A function that will convert a web_sys::Event event to a Message.
MsgEvent(Message, fn(Message, Event) -> Option<Message>)
A function that will convert a web_sys::Event event to a Message.
This variation allows passing data to the event handler via a Message.
InputValue(fn(String) -> Option<Message>)
A function that will convert a String from an input element into a Message.
InputEvent(fn(InputEvent) -> Option<Message>)
A function that will convert a web_sys::InputEvent event to a Message.
Trait Implementations§
impl<Message> StructuralPartialEq for Handler<Message>
Auto Trait Implementations§
impl<Message> Freeze for Handler<Message>where
Message: Freeze,
impl<Message> RefUnwindSafe for Handler<Message>where
Message: RefUnwindSafe,
impl<Message> Send for Handler<Message>where
Message: Send,
impl<Message> Sync for Handler<Message>where
Message: Sync,
impl<Message> Unpin for Handler<Message>where
Message: Unpin,
impl<Message> UnwindSafe for Handler<Message>where
Message: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<M> Update<()> for M
impl<M> Update<()> for M
Source§fn update(&mut self, msg: Message, _commands: &mut Commands<Command>)
fn update(&mut self, msg: Message, _commands: &mut Commands<Command>)
Update the model using the given message. Implement this to describe the behavior of your
app.
Source§fn simple_update(&mut self, _msg: Message)
fn simple_update(&mut self, _msg: Message)
Update the model using the given message. Implement this if your app does not need to use
side effecting commands.