pub struct State {
pub(crate) nodes: HashMap<NodeId, NodeState>,
pub(crate) data: Tree,
pub(crate) root: NodeId,
pub(crate) focus: NodeId,
is_host_focused: bool,
pub(crate) subtrees: HashMap<TreeId, SubtreeState>,
pub(crate) graft_parents: HashMap<TreeId, NodeId>,
}Fields§
§nodes: HashMap<NodeId, NodeState>§data: Tree§root: NodeId§focus: NodeId§is_host_focused: bool§subtrees: HashMap<TreeId, SubtreeState>§graft_parents: HashMap<TreeId, NodeId>Implementations§
Source§impl State
impl State
fn validate_global(&self)
Sourcefn compute_effective_focus(&self) -> NodeId
fn compute_effective_focus(&self) -> NodeId
Computes the effective focus by following the graft chain from ROOT. If ROOT’s focus is on a graft node, follows through to that subtree’s focus, and continues recursively until reaching a non-graft node.
fn update( &mut self, update: TreeUpdate, is_host_focused: bool, changes: Option<&mut InternalChanges>, tree_index: TreeIndex, )
fn update_host_focus_state( &mut self, is_host_focused: bool, changes: Option<&mut InternalChanges>, )
pub fn has_node(&self, id: NodeId) -> bool
pub fn node_by_id(&self, id: NodeId) -> Option<Node<'_>>
pub fn root_id(&self) -> NodeId
pub fn root(&self) -> Node<'_>
Sourcepub fn subtree_root(&self, tree_id: TreeId) -> Option<NodeId>
pub fn subtree_root(&self, tree_id: TreeId) -> Option<NodeId>
Returns the root NodeId of the subtree with the given TreeId, if it exists.
pub fn is_host_focused(&self) -> bool
pub fn focus_id_in_tree(&self) -> NodeId
pub fn focus_in_tree(&self) -> Node<'_>
pub fn focus_id(&self) -> Option<NodeId>
pub fn focus(&self) -> Option<Node<'_>>
pub fn active_dialog(&self) -> Option<Node<'_>>
pub fn toolkit_name(&self) -> Option<&str>
pub fn toolkit_version(&self) -> Option<&str>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
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