iced_runtime/widget/
selector.rs

1//! Find and query widgets in your applications.
2pub use iced_selector::{Bounded, Candidate, Selector, Target, Text, id, is_focused};
3
4use crate::Task;
5use crate::task;
6
7/// Finds a widget matching the given [`Selector`].
8pub fn find<S>(selector: S) -> Task<Option<S::Output>>
9where
10    S: Selector + Send + 'static,
11    S::Output: Send + Clone + 'static,
12{
13    task::widget(selector.find())
14}
15
16/// Finds all widgets matching the given [`Selector`].
17pub fn find_all<S>(selector: S) -> Task<Vec<S::Output>>
18where
19    S: Selector + Send + 'static,
20    S::Output: Send + Clone + 'static,
21{
22    task::widget(selector.find_all())
23}