Trait perseus::Html

pub trait Html: GenericNode<EventType = Event, PropertyType = JsValue> {
    const IS_BROWSER: bool;

    fn to_web_sys(&self) -> Node;
}
Expand description

Trait that is implemented by all [GenericNode] backends that render to HTML.

Required Associated Constants

A boolean indicating whether this node is rendered in a browser context.

A value of false does not necessarily mean that it is not being rendered in WASM or even in the browser. It only means that it does not create DOM nodes.

Required Methods

Convert this node into a raw [web_sys::Node].

For certain backends, this is not possible (e.g. SsrNode). In that case, calling this will panic at runtime.

Implementors