pub trait Applier: Any {
Show 13 methods
// Required methods
fn create(&mut self, node: Box<dyn Node>) -> NodeId;
fn get_mut(&mut self, id: NodeId) -> Result<&mut dyn Node, NodeError>;
fn remove(&mut self, id: NodeId) -> Result<(), NodeError>;
fn node_generation(&self, id: NodeId) -> u32;
fn insert_with_id(
&mut self,
id: NodeId,
node: Box<dyn Node>,
) -> Result<(), NodeError>;
// Provided methods
fn as_any(&self) -> &dyn Any
where Self: Sized { ... }
fn as_any_mut(&mut self) -> &mut dyn Any
where Self: Sized { ... }
fn compact(&mut self) { ... }
fn take_recycled_node(&mut self, _key: TypeId) -> Option<RecycledNode> { ... }
fn set_recycled_node_origin(&mut self, _id: NodeId, _warm_origin: bool) { ... }
fn seed_recycled_node_shell(
&mut self,
_key: TypeId,
_recycle_pool_limit: Option<usize>,
_shell: Box<dyn Node>,
) { ... }
fn record_fresh_recyclable_creation(&mut self, _key: TypeId) { ... }
fn clear_recycled_nodes(&mut self) { ... }
}Required Methods§
fn create(&mut self, node: Box<dyn Node>) -> NodeId
fn get_mut(&mut self, id: NodeId) -> Result<&mut dyn Node, NodeError>
fn remove(&mut self, id: NodeId) -> Result<(), NodeError>
Sourcefn node_generation(&self, id: NodeId) -> u32
fn node_generation(&self, id: NodeId) -> u32
Returns the current generation for a node index. Generation is incremented when an index is reused from the freelist, preventing stale slot entries from matching recycled nodes.
Sourcefn insert_with_id(
&mut self,
id: NodeId,
node: Box<dyn Node>,
) -> Result<(), NodeError>
fn insert_with_id( &mut self, id: NodeId, node: Box<dyn Node>, ) -> Result<(), NodeError>
Inserts a node with a pre-assigned ID.
This is used for virtual nodes whose IDs are allocated separately
(e.g., via allocate_virtual_node_id()). Unlike create() which assigns
a new ID, this method uses the provided ID.
Returns Ok(()) if successful, or an error if the ID is already in use.
Provided Methods§
fn as_any(&self) -> &dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Sourcefn take_recycled_node(&mut self, _key: TypeId) -> Option<RecycledNode>
fn take_recycled_node(&mut self, _key: TypeId) -> Option<RecycledNode>
Returns a previously recycled node shell and its stable ID for the requested concrete type.
Sourcefn set_recycled_node_origin(&mut self, _id: NodeId, _warm_origin: bool)
fn set_recycled_node_origin(&mut self, _id: NodeId, _warm_origin: bool)
Marks whether a reinserted recycled node originated from the warm recycle path.
Sourcefn seed_recycled_node_shell(
&mut self,
_key: TypeId,
_recycle_pool_limit: Option<usize>,
_shell: Box<dyn Node>,
)
fn seed_recycled_node_shell( &mut self, _key: TypeId, _recycle_pool_limit: Option<usize>, _shell: Box<dyn Node>, )
Seeds a warm recyclable shell for future reuse without requiring a prior removal.
Sourcefn record_fresh_recyclable_creation(&mut self, _key: TypeId)
fn record_fresh_recyclable_creation(&mut self, _key: TypeId)
Records that the current apply pass had to allocate a fresh recyclable shell for this type.
Sourcefn clear_recycled_nodes(&mut self)
fn clear_recycled_nodes(&mut self)
Drops any recyclable shells that should not survive beyond the current apply pass.