pub struct MemoryApplier { /* private fields */ }Implementations§
Source§impl MemoryApplier
impl MemoryApplier
pub fn new() -> Self
pub fn slots(&mut self) -> &mut SlotTable
pub fn with_node<N: Node + 'static, R>( &mut self, id: NodeId, f: impl FnOnce(&mut N) -> R, ) -> Result<R, NodeError>
pub fn len(&self) -> usize
pub fn capacity(&self) -> usize
pub fn tombstone_count(&self) -> usize
pub fn freelist_len(&self) -> usize
pub fn debug_recycled_node_count(&self) -> usize
pub fn debug_recycled_node_count_for<N: Node + 'static>(&self) -> usize
pub fn debug_stats(&self) -> MemoryApplierDebugStats
pub fn is_empty(&self) -> bool
pub fn debug_live_node_heap_bytes(&self) -> usize
pub fn debug_recycled_node_heap_bytes(&self) -> usize
pub fn set_runtime_handle(&mut self, handle: RuntimeHandle)
pub fn clear_runtime_handle(&mut self)
pub fn runtime_handle(&self) -> Option<RuntimeHandle>
pub fn dump_tree(&self, root: Option<NodeId>) -> String
Trait Implementations§
Source§impl Applier for MemoryApplier
impl Applier for MemoryApplier
fn create(&mut self, node: Box<dyn Node>) -> NodeId
Source§fn 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.
fn get_mut(&mut self, id: NodeId) -> Result<&mut dyn Node, NodeError>
fn remove(&mut self, id: NodeId) -> Result<(), NodeError>
Source§fn 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. Read more
Source§fn 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.
Source§fn 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.
Source§fn 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.
Source§fn 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.
Source§fn clear_recycled_nodes(&mut self)
fn clear_recycled_nodes(&mut self)
Drops any recyclable shells that should not survive beyond the current apply pass.
fn as_any(&self) -> &dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§impl Default for MemoryApplier
impl Default for MemoryApplier
Source§fn default() -> MemoryApplier
fn default() -> MemoryApplier
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for MemoryApplier
impl !RefUnwindSafe for MemoryApplier
impl !Send for MemoryApplier
impl !Sync for MemoryApplier
impl Unpin for MemoryApplier
impl UnsafeUnpin for MemoryApplier
impl !UnwindSafe for MemoryApplier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more