pub enum StandardComponentType {
BackButton,
CloseButton,
MoreButton,
DrawerButton,
}Expand description
An enum identifying standard UI components.
This enum is used to attach a key to a widget identifying it as a standard UI component for testing and discovery purposes.
It is used by the testing infrastructure to positively identify and/or activate specific widgets as representing standard UI components, since many of these components vary slightly in the icons or tooltips that they use, and making an effective test matcher for them is fragile and error prone.
The keys don’t have any effect on the functioning of the UI elements, they are just a means of identifying them. A widget won’t be treated specially if it has this key, other than to be found by the testing infrastructure. If tests are not searching for them, then adding them to a widget serves no purpose.
Any widget with the key from a value here applied to it will be considered
to be that type of standard UI component in tests.
Types included here are generally only those for which it can be difficult or fragile to create a reliable test matcher for. It is not (nor should it become) an exhaustive list of standard UI components.
Variants§
BackButton
Indicates the associated widget is a standard back button, typically used to navigate back to the previous screen.
CloseButton
Indicates the associated widget is a close button, typically used to dismiss a dialog or modal sheet.
MoreButton
Indicates the associated widget is a “more” button, typically used to display a menu of additional options.
DrawerButton
Indicates the associated widget is a drawer button, typically used to open a drawer.
Implementations§
Source§impl StandardComponentType
impl StandardComponentType
Sourcepub fn key(self) -> KeyRef
pub fn key(self) -> KeyRef
Returns a ValueKey for this StandardComponentType.
Attach this key to a widget to indicate it is a standard UI component.
Trait Implementations§
Source§impl Clone for StandardComponentType
impl Clone for StandardComponentType
impl Copy for StandardComponentType
Source§impl Debug for StandardComponentType
impl Debug for StandardComponentType
impl Eq for StandardComponentType
Source§impl Hash for StandardComponentType
impl Hash for StandardComponentType
Source§impl PartialEq for StandardComponentType
impl PartialEq for StandardComponentType
impl StructuralPartialEq for StandardComponentType
Auto Trait Implementations§
impl Forget for StandardComponentType
impl Freeze for StandardComponentType
impl Move for StandardComponentType
impl RefUnwindSafe for StandardComponentType
impl Send for StandardComponentType
impl Sync for StandardComponentType
impl Unpin for StandardComponentType
impl UnsafeUnpin for StandardComponentType
impl UnwindSafe for StandardComponentType
Blanket Implementations§
Source§impl<T> AnyEq for T
impl<T> AnyEq for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.