pub enum Selector {
Id {
widget_id: String,
window_id: Option<String>,
},
Text(String),
Role(String),
Label(String),
Focused,
}Expand description
A selector that identifies a widget in the UI tree.
Used by the automation layer to target interactions (click, type_text, etc.) and queries (find, assert). The selector is resolved against the current widget tree to locate the target.
Variants§
Id
Match a widget by its ID (local or scoped path).
The widget_id may be a bare local name ("save"), a scoped
path ("form/save"), or a window-qualified ID ("main#save").
Bare names and partial scoped paths also match as trailing
segments, so "form/save" finds a node with the fully
qualified id "main#form/save". When window_id is set, the
search is restricted to that window’s subtree.
Text(String)
Match a widget by its visible text content.
Searches the content, label, value, and placeholder
props for a matching string.
Role(String)
Match a widget by its accessibility role.
Label(String)
Match a widget by its accessibility label.
Focused
Match the widget that currently has keyboard focus.
Implementations§
Source§impl Selector
impl Selector
Sourcepub fn id(id: &str) -> Selector
pub fn id(id: &str) -> Selector
Create an ID selector.
If the ID contains #, the prefix is extracted as the
window ID for scoped search.
Sourcepub fn id_in_window(id: &str, window_id: &str) -> Selector
pub fn id_in_window(id: &str, window_id: &str) -> Selector
Create an ID selector with an explicit window scope.
Trait Implementations§
impl Eq for Selector
Source§impl From<&str> for Selector
Convenience conversion from &str to Selector::Id.
impl From<&str> for Selector
Convenience conversion from &str to Selector::Id.
Bare strings are treated as ID selectors. Supports the #
syntax for window qualification ("main#save").
impl StructuralPartialEq for Selector
Auto Trait Implementations§
impl Freeze for Selector
impl RefUnwindSafe for Selector
impl Send for Selector
impl Sync for Selector
impl Unpin for Selector
impl UnsafeUnpin for Selector
impl UnwindSafe for Selector
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.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>
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>
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