pub struct InteractiveElement {Show 13 fields
pub selector: String,
pub element_type: String,
pub text: String,
pub description: String,
pub visible: bool,
pub enabled: bool,
pub tag: Option<String>,
pub id: Option<String>,
pub classes: Vec<String>,
pub aria_label: Option<String>,
pub placeholder: Option<String>,
pub value: Option<String>,
pub bounds: Option<[f64; 4]>,
}Expand description
An interactive element on the page.
Fields§
§selector: StringCSS selector for this element.
element_type: StringType of element (button, input, link, etc.).
text: StringVisible text content.
description: StringDescription of the element’s purpose.
visible: boolWhether the element is visible.
enabled: boolWhether the element is enabled.
tag: Option<String>Element tag name.
id: Option<String>Element ID.
classes: Vec<String>Element classes.
aria_label: Option<String>ARIA label.
placeholder: Option<String>Placeholder text (for inputs).
value: Option<String>Current value (for inputs).
bounds: Option<[f64; 4]>Bounding box [x, y, width, height].
Implementations§
Source§impl InteractiveElement
impl InteractiveElement
Sourcepub fn new(
selector: impl Into<String>,
element_type: impl Into<String>,
) -> InteractiveElement
pub fn new( selector: impl Into<String>, element_type: impl Into<String>, ) -> InteractiveElement
Create a new interactive element.
Create a button element.
Sourcepub fn input(
selector: impl Into<String>,
input_type: &str,
) -> InteractiveElement
pub fn input( selector: impl Into<String>, input_type: &str, ) -> InteractiveElement
Create an input element.
Sourcepub fn link(
selector: impl Into<String>,
text: impl Into<String>,
) -> InteractiveElement
pub fn link( selector: impl Into<String>, text: impl Into<String>, ) -> InteractiveElement
Create a link element.
Sourcepub fn with_text(self, text: impl Into<String>) -> InteractiveElement
pub fn with_text(self, text: impl Into<String>) -> InteractiveElement
Set text.
Sourcepub fn with_description(self, desc: impl Into<String>) -> InteractiveElement
pub fn with_description(self, desc: impl Into<String>) -> InteractiveElement
Set description.
Sourcepub fn visible(self, visible: bool) -> InteractiveElement
pub fn visible(self, visible: bool) -> InteractiveElement
Set visibility.
Sourcepub fn enabled(self, enabled: bool) -> InteractiveElement
pub fn enabled(self, enabled: bool) -> InteractiveElement
Set enabled state.
Sourcepub fn with_placeholder(
self,
placeholder: impl Into<String>,
) -> InteractiveElement
pub fn with_placeholder( self, placeholder: impl Into<String>, ) -> InteractiveElement
Set placeholder.
Sourcepub fn with_aria_label(self, label: impl Into<String>) -> InteractiveElement
pub fn with_aria_label(self, label: impl Into<String>) -> InteractiveElement
Set aria label.
Sourcepub fn is_actionable(&self) -> bool
pub fn is_actionable(&self) -> bool
Check if this element can be interacted with.
Trait Implementations§
Source§impl Clone for InteractiveElement
impl Clone for InteractiveElement
Source§fn clone(&self) -> InteractiveElement
fn clone(&self) -> InteractiveElement
Returns a duplicate of the value. Read more
1.0.0 · 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 InteractiveElement
impl Debug for InteractiveElement
Source§impl Default for InteractiveElement
impl Default for InteractiveElement
Source§fn default() -> InteractiveElement
fn default() -> InteractiveElement
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for InteractiveElement
impl<'de> Deserialize<'de> for InteractiveElement
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<InteractiveElement, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<InteractiveElement, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for InteractiveElement
impl Serialize for InteractiveElement
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for InteractiveElement
impl RefUnwindSafe for InteractiveElement
impl Send for InteractiveElement
impl Sync for InteractiveElement
impl Unpin for InteractiveElement
impl UnwindSafe for InteractiveElement
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