pub struct Focus { /* private fields */ }Expand description
Current interaction target (separate from history). Focus only applies to nodes that are present and experience-visible.
Implementations§
Source§impl Focus
impl Focus
pub fn new() -> Self
pub fn current(&self) -> Option<NodeId>
pub fn is_focused(&self, id: NodeId) -> bool
Sourcepub fn set(&mut self, field: &Field, id: NodeId) -> bool
pub fn set(&mut self, field: &Field, id: NodeId) -> bool
Set focus to id if it exists and is experience-visible.
pub fn clear(&mut self)
Sourcepub fn on_removed(&mut self, removed: NodeId)
pub fn on_removed(&mut self, removed: NodeId)
If the focused node is removed, clear focus.
If the focused node becomes hidden (collapse/hide/detach), clear focus.
Trait Implementations§
impl Copy for Focus
impl Eq for Focus
impl StructuralPartialEq for Focus
Auto Trait Implementations§
impl Freeze for Focus
impl RefUnwindSafe for Focus
impl Send for Focus
impl Sync for Focus
impl Unpin for Focus
impl UnsafeUnpin for Focus
impl UnwindSafe for Focus
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