pub struct FocusScopeNode { /* private fields */ }Expand description
Persistent focus scope handle.
Scopes own restore behavior and provide imperative traversal within a subtree.
§Examples
use tessera_ui::FocusScopeNode;
let first = FocusScopeNode::new();
let second = FocusScopeNode::new();
assert_ne!(first, second);Implementations§
Source§impl FocusScopeNode
impl FocusScopeNode
Sourcepub fn request_focus(&self)
pub fn request_focus(&self)
Requests focus within this scope, restoring the last focused descendant when possible.
Sourcepub fn clear_focus(&self)
pub fn clear_focus(&self)
Clears focus from this scope.
Sourcepub fn restore_focus(&self)
pub fn restore_focus(&self)
Restores focus to the last focused descendant of this scope.
Sourcepub fn move_focus(&self, direction: FocusDirection) -> bool
pub fn move_focus(&self, direction: FocusDirection) -> bool
Moves focus to another focusable descendant inside this scope.
Sourcepub fn cycle_focus(&self, direction: FocusDirection) -> bool
pub fn cycle_focus(&self, direction: FocusDirection) -> bool
Cycles focus inside this scope, wrapping when traversal reaches an end.
Sourcepub fn state(&self) -> FocusState
pub fn state(&self) -> FocusState
Returns the current focus state for this scope.
Sourcepub fn has_focus(&self) -> bool
pub fn has_focus(&self) -> bool
Returns true when this scope participates in the active focus path.
Sourcepub fn is_focused(&self) -> bool
pub fn is_focused(&self) -> bool
Returns true when this scope itself is the primary focused node.
Trait Implementations§
Source§impl Clone for FocusScopeNode
impl Clone for FocusScopeNode
Source§fn clone(&self) -> FocusScopeNode
fn clone(&self) -> FocusScopeNode
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 FocusScopeNode
impl Debug for FocusScopeNode
Source§impl Default for FocusScopeNode
impl Default for FocusScopeNode
Source§impl Hash for FocusScopeNode
impl Hash for FocusScopeNode
Source§impl PartialEq for FocusScopeNode
impl PartialEq for FocusScopeNode
impl Copy for FocusScopeNode
impl Eq for FocusScopeNode
impl StructuralPartialEq for FocusScopeNode
Auto Trait Implementations§
impl Freeze for FocusScopeNode
impl RefUnwindSafe for FocusScopeNode
impl Send for FocusScopeNode
impl Sync for FocusScopeNode
impl Unpin for FocusScopeNode
impl UnwindSafe for FocusScopeNode
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
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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>
Converts
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>
Converts
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)
Converts
&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)
Converts
&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
Compare self to
key and return true if they are equal.§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
Checks if this value is equivalent to the given key. Read more
§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
Checks if this value is equivalent to the given key. 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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.