Skip to main content

RealDom

Trait RealDom 

Source
pub trait RealDom {
    type Event;
    type MouseEvent;
    type EventCallback: Clone;
}
Expand description

In some applications, VirtualNode get converted into real DOM nodes.

This trait contains types and methods for manipulating a real DOM.

When running a client-side web application, consider using web_sys::Window as the RealDom. When running on a server, consider using the null () type as the RealDom.

To control how a VirtualNode gets rendered to a DOM element, implement RealDom for your own custom type.

Required Associated Types§

Source

type Event

The event type. In the web this is web_sys::Event.

Source

type MouseEvent

The event type for mouse events. In the web this is web_sys::MouseEvent.

Source

type EventCallback: Clone

The type for callbacks such as |some_event| { ... }.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl RealDom for ()

Source§

impl RealDom for Window

Available on crate feature web only.

An RealDom implementation that uses web_sys’s event types.

Implementors§