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§
Sourcefn element_type(&self) -> TypeId
fn element_type(&self) -> TypeId
The type of the element itself.
Sourcefn create_node(&self) -> Rc<RefCell<dyn ModifierNode>>
fn create_node(&self) -> Rc<RefCell<dyn ModifierNode>>
A new node for this element, in the shared cell its chain entry keeps.
Sourcefn can_update_node(&self, node: &dyn ModifierNode) -> bool
fn can_update_node(&self, node: &dyn ModifierNode) -> bool
Whether node is of the type that this element updates.
Sourcefn update_node(&self, node: &mut dyn ModifierNode)
fn update_node(&self, node: &mut dyn ModifierNode)
Brings node up to date with the data of this element.
Sourcefn key(&self) -> Option<u64>
fn key(&self) -> Option<u64>
The key that tells apart several elements of one type, or None when the element has none.
Sourcefn hash_code(&self) -> u64
fn hash_code(&self) -> u64
The hash of the element, computed once when the element was wrapped.
Sourcefn equals_element(&self, other: &dyn AnyModifierElement) -> bool
fn equals_element(&self, other: &dyn AnyModifierElement) -> bool
Whether other is an element of the same type with equal data.
Sourcefn inspector_name(&self) -> &'static str
fn inspector_name(&self) -> &'static str
The name that inspector tooling shows for the element.
Sourcefn record_inspector_properties(
&self,
visitor: &mut dyn FnMut(&'static str, String),
)
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.
Sourcefn requires_update(&self) -> bool
fn requires_update(&self) -> bool
Whether the node must be updated even when the new element equals the old one.
Sourcefn auto_invalidates_on_update(&self) -> bool
fn auto_invalidates_on_update(&self) -> bool
Whether updating an existing node invalidates all pipeline stages that its capabilities cover.
Sourcefn update_invalidation_kind(&self) -> Option<InvalidationKind>
fn update_invalidation_kind(&self) -> Option<InvalidationKind>
The one pipeline stage that an update invalidates, or None to invalidate by capabilities.
Provided Methods§
Sourcefn capabilities(&self) -> NodeCapabilities
fn capabilities(&self) -> NodeCapabilities
The capabilities of the nodes that the element creates.
Sourcefn provides_composition_locals(&self) -> bool
fn provides_composition_locals(&self) -> bool
Whether this element has composition locals for its content.
Sourcefn provided_composition_locals(&self) -> Vec<ProvidedValue>
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".