dioxus_native_core::custom_element

Trait CustomElementFactory

Source
pub trait CustomElementFactory<W: CustomElementUpdater<V>, V: FromAnyValue + Send + Sync = ()>:
    Send
    + Sync
    + 'static {
    const NAME: &'static str;
    const NAMESPACE: Option<&'static str> = None;

    // Required method
    fn create(dom: NodeMut<'_, V>) -> W;
}
Expand description

A factory for creating custom elements

Register with RealDom::register_custom_element_with_factory

Required Associated Constants§

Source

const NAME: &'static str

The tag of the element

Provided Associated Constants§

Source

const NAMESPACE: Option<&'static str> = None

The namespace of the element

Required Methods§

Source

fn create(dom: NodeMut<'_, V>) -> W

Create a new element without mounting it. The node passed in is the light DOM node. The element should not modify the light DOM node, but it can get the NodeMut::real_dom_mut from the node to create new nodes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<W: CustomElement<V>, V: FromAnyValue + Send + Sync> CustomElementFactory<W, V> for W

Source§

const NAME: &'static str = W::NAME

Source§

const NAMESPACE: Option<&'static str> = W::NAMESPACE