pub struct Torin<Key: NodeKey> {
pub results: FxHashMap<Key, LayoutNode>,
pub dirty: FxHashMap<Key, DirtyReason>,
pub root_node_candidate: RootNodeCandidate<Key>,
}Fields§
§results: FxHashMap<Key, LayoutNode>Layout results of the registered Nodes
dirty: FxHashMap<Key, DirtyReason>Invalid registered nodes since previous layout measurement
root_node_candidate: RootNodeCandidate<Key>Best Root node candidate from where to start measuringg
Implementations§
Source§impl<Key: NodeKey> Torin<Key>
impl<Key: NodeKey> Torin<Key>
pub fn size(&self) -> usize
Sourcepub fn clear_dirty(&mut self)
pub fn clear_dirty(&mut self)
Clear the dirty nodes buffer
Sourcepub fn get_dirty_nodes(&self) -> &FxHashMap<Key, DirtyReason>
pub fn get_dirty_nodes(&self) -> &FxHashMap<Key, DirtyReason>
Read the HashSet of dirty nodes
Sourcepub fn raw_remove(&mut self, node_id: Key)
pub fn raw_remove(&mut self, node_id: Key)
Remove a Node’s result and data
Sourcepub fn remove(
&mut self,
node_id: Key,
tree_adapter: &mut impl TreeAdapter<Key>,
invalidate_parent: bool,
)
pub fn remove( &mut self, node_id: Key, tree_adapter: &mut impl TreeAdapter<Key>, invalidate_parent: bool, )
Sourcepub fn safe_invalidate(&mut self, node_id: Key)
pub fn safe_invalidate(&mut self, node_id: Key)
Safely mark as dirty a Node, with no reason.
Sourcepub fn invalidate(&mut self, node_id: Key)
pub fn invalidate(&mut self, node_id: Key)
Mark as dirty a Node, with no reason.
Sourcepub fn invalidate_with_reason(&mut self, node_id: Key, reason: DirtyReason)
pub fn invalidate_with_reason(&mut self, node_id: Key, reason: DirtyReason)
Mark as dirty a Node, with a reason.
pub fn check_dirty_dependants( &mut self, node_id: Key, reason: DirtyReason, tree_adapter: &mut impl TreeAdapter<Key>, ignore: bool, )
Sourcepub fn get_root_candidate(&self) -> RootNodeCandidate<Key>
pub fn get_root_candidate(&self) -> RootNodeCandidate<Key>
Get the Root Node candidate
Sourcepub fn find_best_root(&mut self, tree_adapter: &mut impl TreeAdapter<Key>)
pub fn find_best_root(&mut self, tree_adapter: &mut impl TreeAdapter<Key>)
Find the best root Node from where to start measuringg
Sourcepub fn measure(
&mut self,
suggested_root_id: Key,
root_area: Area,
measurer: &mut Option<impl LayoutMeasurer<Key>>,
tree_adapter: &mut impl TreeAdapter<Key>,
)
pub fn measure( &mut self, suggested_root_id: Key, root_area: Area, measurer: &mut Option<impl LayoutMeasurer<Key>>, tree_adapter: &mut impl TreeAdapter<Key>, )
Sourcepub fn get(&self, node_id: &Key) -> Option<&LayoutNode>
pub fn get(&self, node_id: &Key) -> Option<&LayoutNode>
Get a reference to LayoutNode of a Node
Sourcepub fn get_mut(&mut self, node_id: &Key) -> Option<&mut LayoutNode>
pub fn get_mut(&mut self, node_id: &Key) -> Option<&mut LayoutNode>
Get a mutable reference to LayoutNode of a Node
Sourcepub fn cache_node(&mut self, node_id: Key, layout_node: LayoutNode)
pub fn cache_node(&mut self, node_id: Key, layout_node: LayoutNode)
Cache a Node’s LayoutNode
Trait Implementations§
Auto Trait Implementations§
impl<Key> Freeze for Torin<Key>where
Key: Freeze,
impl<Key> !RefUnwindSafe for Torin<Key>
impl<Key> !Send for Torin<Key>
impl<Key> !Sync for Torin<Key>
impl<Key> Unpin for Torin<Key>where
Key: Unpin,
impl<Key> !UnwindSafe for Torin<Key>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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