Enum virtual_node::event::ManagedEvent[][src]

pub enum ManagedEvent {
    Delegated(EventHandler),
    NonDelegated(EventHandlerRc<dyn AsRef<JsValue>>),
}
Expand description

An event that to be managed by the PercyDom.

Variants

Delegated(EventHandler)

Every kind of delegated event, such as onclick, has a single event listener attached to the PercyDom’s mount. When that listener is called, it looks up the proper ManagedEvent::Delegated event to call.

Tuple Fields of Delegated

0: EventHandler
NonDelegated(EventHandlerRc<dyn AsRef<JsValue>>)

For non delegated events, an event listener is attached to the DOM element using .add_event_listener(); That event listener is an EventWrapper, which in turn will find and call the EventAttribFn. This setup allows us to replace the EventAttribFn after every render without needing to re-attach event listeners.

Tuple Fields of NonDelegated

0: EventHandler1: Rc<dyn AsRef<JsValue>>

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.