pub trait AnyModifierElement: Debug {
Show 16 methods
// Required methods
fn element_type(&self) -> TypeId;
fn maker(&self) -> ElementMaker<'_>;
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> { ... }
fn equals_node(&self, _node: &dyn ModifierNode) -> bool { ... }
fn equals_plain(&self, _fns: &PlainFns, _words: &[u32]) -> bool { ... }
}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 maker(&self) -> ElementMaker<'_>
fn maker(&self) -> ElementMaker<'_>
How a chain keeps the element: by a node it makes, or as a value.
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.
Sourcefn equals_node(&self, _node: &dyn ModifierNode) -> bool
fn equals_node(&self, _node: &dyn ModifierNode) -> bool
Whether node is of this element’s node type and keeps an element
equal to this one: always false for an element whose node keeps
none.
Sourcefn equals_plain(&self, _fns: &PlainFns, _words: &[u32]) -> bool
fn equals_plain(&self, _fns: &PlainFns, _words: &[u32]) -> bool
Whether words, the value of a plain element of the type fns
tells, hold a value equal to this element: always false for an
element that is not plain.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".