Skip to main content

AnyModifierElement

Trait AnyModifierElement 

Source
pub trait AnyModifierElement: Debug {
Show 17 methods // Required methods fn node_type(&self) -> TypeId; fn element_type(&self) -> TypeId; fn create_node(&self) -> Rc<RefCell<dyn ModifierNode>>; fn can_update_node(&self, node: &dyn ModifierNode) -> bool; fn update_node(&self, node: &mut dyn ModifierNode); fn key(&self) -> Option<u64>; fn hash_code(&self) -> u64; fn equals_element(&self, other: &dyn AnyModifierElement) -> bool; fn inspector_name(&self) -> &'static str; fn record_inspector_properties( &self, visitor: &mut dyn FnMut(&'static str, String), ); fn requires_update(&self) -> bool; fn auto_invalidates_on_update(&self) -> bool; fn update_invalidation_kind(&self) -> Option<InvalidationKind>; fn as_any(&self) -> &dyn Any; // Provided methods fn capabilities(&self) -> NodeCapabilities { ... } fn provides_composition_locals(&self) -> bool { ... } fn provided_composition_locals(&self) -> Vec<ProvidedValue> { ... }
}
Expand description

Type-erased modifier element used by the runtime to reconcile chains.

Required Methods§

Source

fn node_type(&self) -> TypeId

The type of node that the element creates.

Source

fn element_type(&self) -> TypeId

The type of the element itself.

Source

fn create_node(&self) -> Rc<RefCell<dyn ModifierNode>>

A new node for this element, in the shared cell its chain entry keeps.

Source

fn can_update_node(&self, node: &dyn ModifierNode) -> bool

Whether node is of the type that this element updates.

Source

fn update_node(&self, node: &mut dyn ModifierNode)

Brings node up to date with the data of this element.

Source

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

The key that tells apart several elements of one type, or None when the element has none.

Source

fn hash_code(&self) -> u64

The hash of the element, computed once when the element was wrapped.

Source

fn equals_element(&self, other: &dyn AnyModifierElement) -> bool

Whether other is an element of the same type with equal data.

Source

fn inspector_name(&self) -> &'static str

The name that inspector tooling shows for the element.

Source

fn record_inspector_properties( &self, visitor: &mut dyn FnMut(&'static str, String), )

Reports each inspector property of the element to visitor as a name and a value.

Source

fn requires_update(&self) -> bool

Whether the node must be updated even when the new element equals the old one.

Source

fn auto_invalidates_on_update(&self) -> bool

Whether updating an existing node invalidates all pipeline stages that its capabilities cover.

Source

fn update_invalidation_kind(&self) -> Option<InvalidationKind>

The one pipeline stage that an update invalidates, or None to invalidate by capabilities.

Source

fn as_any(&self) -> &dyn Any

Returns the element as Any, for downcasting to its concrete type.

Provided Methods§

Source

fn capabilities(&self) -> NodeCapabilities

The capabilities of the nodes that the element creates.

Source

fn provides_composition_locals(&self) -> bool

Whether this element has composition locals for its content.

Source

fn provided_composition_locals(&self) -> Vec<ProvidedValue>

The composition locals this element hands to its content.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§