This is unreleased documentation for Yew Next version.
For up-to-date documentation, see the latest version on docs.rs.
yew::virtual_dom

Trait Listener

Source
pub trait Listener {
    // Required methods
    fn kind(&self) -> ListenerKind;
    fn handle(&self, event: Event);
    fn passive(&self) -> bool;
}
Expand description

The Listener trait is an universal implementation of an event listener which is used to bind Rust-listener to JS-listener (DOM).

Required Methods§

Source

fn kind(&self) -> ListenerKind

Returns the name of the event

Source

fn handle(&self, event: Event)

Handles an event firing

Source

fn passive(&self) -> bool

Makes the event listener passive. See addEventListener.

Trait Implementations§

Source§

impl Debug for dyn Listener

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§