Skip to main content

ModifierNode

Trait ModifierNode 

Source
pub trait ModifierNode: Any {
    // Required method
    fn as_any(&self) -> &dyn Any;

    // Provided methods
    fn on_attach(&self) { ... }
    fn on_detach(&self) { ... }
}
Expand description

A live modifier node.

Implementors keep their own state behind interior mutability. Lifecycle callbacks run once: on_attach the first time the node is painted, on_detach when the last handle referencing it is dropped.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Upcast hook used to downcast to the concrete node type.

Provided Methods§

Source

fn on_attach(&self)

Source

fn on_detach(&self)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§