pub struct FocusChain {
pub targets: Vec<FocusTarget>,
pub active_index: Option<usize>,
}Expand description
Ordered focus targets with wrapping traversal and disabled-item skipping.
Fields§
§targets: Vec<FocusTarget>§active_index: Option<usize>Implementations§
Source§impl FocusChain
impl FocusChain
pub fn new(targets: impl IntoIterator<Item = FocusTarget>) -> Self
pub fn active(&self) -> Option<&FocusTarget>
pub fn active_id(&self) -> Option<&str>
pub fn set_active(&mut self, id: &str) -> bool
pub fn move_focus(&mut self, direction: FocusDirection) -> Option<&FocusTarget>
Trait Implementations§
Source§impl Clone for FocusChain
impl Clone for FocusChain
Source§fn clone(&self) -> FocusChain
fn clone(&self) -> FocusChain
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 FocusChain
impl Debug for FocusChain
Source§impl Default for FocusChain
impl Default for FocusChain
Source§fn default() -> FocusChain
fn default() -> FocusChain
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for FocusChain
impl<'de> Deserialize<'de> for FocusChain
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for FocusChain
Source§impl PartialEq for FocusChain
impl PartialEq for FocusChain
Source§fn eq(&self, other: &FocusChain) -> bool
fn eq(&self, other: &FocusChain) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for FocusChain
impl Serialize for FocusChain
impl StructuralPartialEq for FocusChain
Auto Trait Implementations§
impl Freeze for FocusChain
impl RefUnwindSafe for FocusChain
impl Send for FocusChain
impl Sync for FocusChain
impl Unpin for FocusChain
impl UnsafeUnpin for FocusChain
impl UnwindSafe for FocusChain
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