Write documentation for iced_test
This commit is contained in:
parent
8f6f5c13b0
commit
5220a064c5
7 changed files with 189 additions and 13 deletions
|
|
@ -1,9 +1,13 @@
|
|||
//! Select widgets of a user interface.
|
||||
use crate::core::text;
|
||||
use crate::core::widget;
|
||||
|
||||
/// A selector describes a strategy to find a certain widget in a user interface.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Selector {
|
||||
/// Find the widget with the given [`widget::Id`].
|
||||
Id(widget::Id),
|
||||
/// Find the widget containing the given [`text::Fragment`].
|
||||
Text(text::Fragment<'static>),
|
||||
}
|
||||
|
||||
|
|
@ -19,6 +23,7 @@ impl From<&'static str> for Selector {
|
|||
}
|
||||
}
|
||||
|
||||
/// Creates [`Selector`] that finds the widget containing the given text fragment.
|
||||
pub fn text(fragment: impl text::IntoFragment<'static>) -> Selector {
|
||||
Selector::Text(fragment.into_fragment())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue