Skip to main content

WdElement

Derive Macro WdElement 

Source
#[derive(WdElement)]
{
    // Attributes available to this derive:
    #[wd_element]
}
Expand description

Derive macro for WebDynpro elements.

Generates the definition struct, Element trait impl, optional Interactable trait impl, constructor, and inventory::submit! registration.

§Example

#[derive(WdElement)]
#[wd_element(control_id = "B", element_name = "Button")]
#[wd_element(interactable)]
#[wd_element(def = "ButtonDef", def_doc = "Button definition")]
#[wd_element(lsdata = "ButtonLsData")]
pub struct Button<'a> {
    id: Cow<'static, str>,
    #[wd_element(element_ref)]
    element_ref: scraper::ElementRef<'a>,
    #[wd_element(lsdata_field)]
    lsdata: OnceCell<ButtonLsData>,
    #[wd_element(lsevents_field)]
    lsevents: OnceCell<Option<EventParameterMap>>,
}