pub struct FocusRequester { /* private fields */ }Expand description
Imperative handle used to request focus for a registered target.
Requesters are stable handles that can be stored in component state and passed across component boundaries without exposing the underlying focus tree.
Implementations§
Source§impl FocusRequester
impl FocusRequester
Sourcepub fn request_focus(&self)
pub fn request_focus(&self)
Requests focus for the bound target.
An attached target hidden by layout rejects the request. Navigation can still reveal a placed target outside its scroll viewport.
Sourcepub fn clear_focus(&self)
pub fn clear_focus(&self)
Clears focus from the bound target if it currently holds it.
Sourcepub fn unfocus(&self)
pub fn unfocus(&self)
Alias for Self::clear_focus.
Sourcepub fn capture_focus(&self)
pub fn capture_focus(&self)
Captures focus on this node, preventing focus from moving elsewhere until released, force-cleared, hidden by layout, or removed.
Sourcepub fn free_focus(&self)
pub fn free_focus(&self)
Releases captured focus from this node.
Sourcepub fn state(&self) -> FocusState
pub fn state(&self) -> FocusState
Returns the current focus state for the bound target.
Sourcepub fn is_focused(&self) -> bool
pub fn is_focused(&self) -> bool
Returns true when this node is the primary focused node.
Sourcepub fn is_focus_visible(&self) -> bool
pub fn is_focus_visible(&self) -> bool
Returns whether the focused target should display a keyboard focus indicator.
Pointer presses hide the indicator without releasing focus. Keyboard input and accessibility focus actions show it; programmatic focus inherits the most recent input mode. Read this during component composition.
Sourcepub fn is_captured(&self) -> bool
pub fn is_captured(&self) -> bool
Returns true when this node has captured focus.
Trait Implementations§
Source§impl Clone for FocusRequester
impl Clone for FocusRequester
Source§fn clone(&self) -> FocusRequester
fn clone(&self) -> FocusRequester
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FocusRequester
Source§impl Debug for FocusRequester
impl Debug for FocusRequester
Source§impl Default for FocusRequester
impl Default for FocusRequester
impl Eq for FocusRequester
Source§impl Hash for FocusRequester
impl Hash for FocusRequester
Source§impl PartialEq for FocusRequester
impl PartialEq for FocusRequester
impl StructuralPartialEq for FocusRequester
Auto Trait Implementations§
impl Freeze for FocusRequester
impl RefUnwindSafe for FocusRequester
impl Send for FocusRequester
impl Sync for FocusRequester
impl Unpin for FocusRequester
impl UnsafeUnpin for FocusRequester
impl UnwindSafe for FocusRequester
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.