dioxus_native_core::custom_element

Trait CustomElementUpdater

Source
pub trait CustomElementUpdater<V: FromAnyValue + Send + Sync = ()>:
    Send
    + Sync
    + 'static {
    // Required methods
    fn attributes_changed(
        &mut self,
        light_root: NodeMut<'_, V>,
        attributes: &AttributeMask,
    );
    fn roots(&self) -> Vec<NodeId>;

    // Provided method
    fn slot(&self) -> Option<NodeId> { ... }
}
Expand description

A trait for updating custom elements

Required Methods§

Source

fn attributes_changed( &mut self, light_root: NodeMut<'_, V>, attributes: &AttributeMask, )

Update the custom element’s shadow tree with the new attributes. Called when the attributes of the custom element are changed.

Source

fn roots(&self) -> Vec<NodeId>

The root node of the custom element. These roots must be not change once the element is created.

Provided Methods§

Source

fn slot(&self) -> Option<NodeId>

The slot to render children of the element into. The slot must be not change once the element is created.

Implementors§