pub struct Element { /* private fields */ }Expand description
A live element with lazy navigation via a provider reference.
Element dereferences to ElementData, so all properties (role, name,
value, states, etc.) are accessible via field access. Navigation
methods (parent(), children()) call the provider on demand.
Elements are cheap to clone (they share the provider via Arc).
Implementations§
Source§impl Element
impl Element
Sourcepub fn new(data: ElementData, provider: Arc<dyn Provider>) -> Self
pub fn new(data: ElementData, provider: Arc<dyn Provider>) -> Self
Create an Element from raw data and a provider reference.
Sourcepub fn data(&self) -> &ElementData
pub fn data(&self) -> &ElementData
Get the underlying ElementData.
Sourcepub fn children(&self) -> Result<Vec<Element>>
pub fn children(&self) -> Result<Vec<Element>>
Get direct children of this element.
Each call queries the provider — results are not cached.
Trait Implementations§
Source§impl Deref for Element
impl Deref for Element
Source§type Target = ElementData
type Target = ElementData
The resulting type after dereferencing.
Source§fn deref(&self) -> &ElementData
fn deref(&self) -> &ElementData
Dereferences the value.
Auto Trait Implementations§
impl Freeze for Element
impl !RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl UnsafeUnpin for Element
impl !UnwindSafe for Element
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