yew_stdweb::virtual_dom

Trait Listener

Source
pub trait Listener {
    // Required methods
    fn kind(&self) -> &'static str;
    fn attach(&self, element: &Element) -> EventListener;
}
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) -> &'static str

Returns the name of the event

Source

fn attach(&self, element: &Element) -> EventListener

Attaches a listener to the element.

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§