Skip to main content

Applier

Trait Applier 

Source
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§

Source

fn create(&mut self, node: Box<dyn Node>) -> NodeId

Source

fn get_mut(&mut self, id: NodeId) -> Result<&mut dyn Node, NodeError>

Source

fn remove(&mut self, id: NodeId) -> Result<(), NodeError>

Source

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.

Source

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§

Source

fn as_any(&self) -> &dyn Any
where Self: Sized,

Source

fn as_any_mut(&mut self) -> &mut dyn Any
where Self: Sized,

Source

fn compact(&mut self)

Trim trailing tombstones/unused capacity after structural changes.

Source

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.

Source

fn set_recycled_node_origin(&mut self, _id: NodeId, _warm_origin: bool)

Marks whether a reinserted recycled node originated from the warm recycle path.

Source

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.

Source

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.

Source

fn clear_recycled_nodes(&mut self)

Drops any recyclable shells that should not survive beyond the current apply pass.

Implementors§