pub struct TestApplierGuard<'a> { /* private fields */ }Methods from Deref<Target = MemoryApplier>§
pub fn slots(&mut self) -> &mut SlotTable
Sourcepub fn scene_node_attached_to(
&mut self,
node_id: usize,
root: usize,
) -> Option<usize>
pub fn scene_node_attached_to( &mut self, node_id: usize, root: usize, ) -> Option<usize>
Drains the parents recorded via Applier::record_structural_change,
keeping only nodes still attached to root (a parent that was itself
removed is covered by its own surviving ancestor’s record). A virtual
parent — a subcompose slot wrapper the render graph never contains —
is reported as its nearest non-virtual ancestor: that is the node
whose graph child set the change altered, and an id the graph cannot
resolve would force the scoped scene update to give up and rebuild.
Resolves a scene-scope candidate the way structural records are
resolved: to its nearest non-virtual ancestor, and only while still
attached to root. A node detached after recording must not reach the
scoped scene update — an id the graph cannot resolve forces it to give
up and rebuild the whole scene.
Sourcepub fn scene_nodes_attached_to(
&mut self,
nodes: impl IntoIterator<Item = usize>,
root: usize,
) -> Vec<Option<usize>>
pub fn scene_nodes_attached_to( &mut self, nodes: impl IntoIterator<Item = usize>, root: usize, ) -> Vec<Option<usize>>
Self::scene_node_attached_to for each of nodes, in order, with
every ancestor looked up at most once: a batch costs the distinct
ancestors of its nodes, not each node’s depth.
Sourcepub fn scene_nodes_attached_to_into(
&mut self,
nodes: impl IntoIterator<Item = usize>,
root: usize,
output: &mut Vec<Option<usize>>,
scratch: &mut SceneNodeAttachmentScratch,
)
pub fn scene_nodes_attached_to_into( &mut self, nodes: impl IntoIterator<Item = usize>, root: usize, output: &mut Vec<Option<usize>>, scratch: &mut SceneNodeAttachmentScratch, )
Fills output with Self::scene_nodes_attached_to results, reusing
its storage and the ancestry cache in scratch across batches.
Each distinct ancestor is inspected at most once per call. The cache is cleared for each call, so graph mutations are observed by the next batch.
use cranpose_core::{MemoryApplier, NodeId, SceneNodeAttachmentScratch};
let mut applier = MemoryApplier::new();
let mut scratch = SceneNodeAttachmentScratch::default();
let mut attached: Vec<Option<NodeId>> = Vec::new();
let root = NodeId::default();
applier.scene_nodes_attached_to_into([], root, &mut attached, &mut scratch);
assert!(attached.is_empty());pub fn take_structural_change_parents_attached_to( &mut self, root: usize, ) -> Vec<usize>
Sourcepub fn take_structural_change_parents_into(&mut self, output: &mut Vec<usize>)
pub fn take_structural_change_parents_into(&mut self, output: &mut Vec<usize>)
Takes the recorded structural-change candidates into reusable storage.
Candidates are not resolved or attachment-filtered; callers that route
them into scenes should use Self::scene_nodes_attached_to_into.
use cranpose_core::MemoryApplier;
let mut applier = MemoryApplier::new();
let mut nodes = Vec::new();
applier.take_structural_change_parents_into(&mut nodes);
assert!(nodes.is_empty());pub fn with_node<N, R>(
&mut self,
id: usize,
f: impl FnOnce(&mut N) -> R,
) -> Result<R, NodeError>where
N: Node + 'static,
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>(&self) -> usizewhere
N: Node + 'static,
pub fn debug_stats(&self) -> MemoryApplierDebugStats
pub fn is_empty(&self) -> bool
Sourcepub fn for_each_node_mut(
&mut self,
visit: impl FnMut(&mut (dyn Node + 'static)),
)
pub fn for_each_node_mut( &mut self, visit: impl FnMut(&mut (dyn Node + 'static)), )
Calls visit with every live node, dense and high-id alike.
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<usize>) -> String
Trait Implementations§
Source§impl Deref for TestApplierGuard<'_>
impl Deref for TestApplierGuard<'_>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for TestApplierGuard<'a>
impl<'a> !Send for TestApplierGuard<'a>
impl<'a> !Sync for TestApplierGuard<'a>
impl<'a> !UnwindSafe for TestApplierGuard<'a>
impl<'a> Freeze for TestApplierGuard<'a>
impl<'a> Unpin for TestApplierGuard<'a>
impl<'a> UnsafeUnpin for TestApplierGuard<'a>
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more