pub enum FocusState {
Active,
ActiveParent,
Captured,
Inactive,
}Expand description
Focus state of a focus target node.
This mirrors Jetpack Compose’s FocusState enum which tracks whether a node is focused, has a focused child, or is inactive.
Variants§
Active
The focusable component is currently active (i.e. it receives key events).
ActiveParent
One of the descendants of the focusable component is Active.
Captured
The focusable component is currently active (has focus), and is in a state where it does not want to give up focus. (Eg. a text field with an invalid phone number).
Inactive
The focusable component does not receive any key events. (ie it is not active, nor are any of its descendants active).
Implementations§
Source§impl FocusState
impl FocusState
Sourcepub fn is_focused(self) -> bool
pub fn is_focused(self) -> bool
Returns whether the component is focused (Active or Captured).
Sourcepub fn is_captured(self) -> bool
pub fn is_captured(self) -> bool
Returns whether focus is captured.
Trait Implementations§
Source§impl Clone for FocusState
impl Clone for FocusState
Source§fn clone(&self) -> FocusState
fn clone(&self) -> FocusState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FocusState
impl Debug for FocusState
Source§impl Default for FocusState
impl Default for FocusState
Source§fn default() -> FocusState
fn default() -> FocusState
Returns the “default value” for a type. Read more
Source§impl Hash for FocusState
impl Hash for FocusState
Source§impl PartialEq for FocusState
impl PartialEq for FocusState
impl Copy for FocusState
impl Eq for FocusState
impl StructuralPartialEq for FocusState
Auto Trait Implementations§
impl Freeze for FocusState
impl RefUnwindSafe for FocusState
impl Send for FocusState
impl Sync for FocusState
impl Unpin for FocusState
impl UnwindSafe for FocusState
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