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§