Skip to main content

ModifierNodeElement

Trait ModifierNodeElement 

Source
pub trait ModifierNodeElement: Any {
    // Required methods
    fn create(&self) -> Rc<dyn ModifierNode>;
    fn update(&self, node: &Rc<dyn ModifierNode>);

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

A description of one modifier node.

create builds the node when there is nothing to reuse. update copies the element’s current configuration into an existing node without replacing its state, which is what makes a node persistent.

Required Methods§

Source

fn create(&self) -> Rc<dyn ModifierNode>

Source

fn update(&self, node: &Rc<dyn ModifierNode>)

Provided Methods§

Source

fn key(&self) -> Option<u64>

Extra identity beyond the element type. Two elements of the same type with different keys never share a node.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§