#[repr(C)]pub struct Dom {
pub root: NodeData,
pub children: DomVec,
pub estimated_total_children: usize,
}Expand description
The document model, similar to HTML. This is a create-only structure, you don’t actually read anything back from it. It’s designed for ease of construction.
Fields§
§root: NodeDataThe data for the root node of this DOM (or sub-DOM).
children: DomVecThe children of this DOM node.
estimated_total_children: usizeImplementations§
Source§impl Dom
impl Dom
Sourcepub fn create_node(node_type: NodeType) -> Self
pub fn create_node(node_type: NodeType) -> Self
Creates an empty DOM with a give NodeType. Note: This is a const fn and
doesn’t allocate, it only allocates once you add at least one child node.
pub fn from_data(node_data: NodeData) -> Self
Sourcepub const fn create_html() -> Self
pub const fn create_html() -> Self
Creates the root HTML element.
Accessibility: The <html> element is the root of an HTML document and should have a
lang attribute.
Sourcepub const fn create_head() -> Self
pub const fn create_head() -> Self
Creates the document head element.
Accessibility: The <head> contains metadata. Use <title> for page titles.
pub const fn create_body() -> Self
Sourcepub const fn create_div() -> Self
pub const fn create_div() -> Self
Creates a generic block-level container.
Accessibility: Prefer semantic elements like <article>, <section>, <nav> when
applicable.
Sourcepub const fn create_article() -> Self
pub const fn create_article() -> Self
Creates an article element.
Accessibility: Represents self-contained content that could be distributed independently. Screen readers can navigate by articles. Consider adding aria-label for multiple articles.
Sourcepub const fn create_section() -> Self
pub const fn create_section() -> Self
Creates a section element.
Accessibility: Represents a thematic grouping of content with a heading. Should typically have a heading (h1-h6) as a child. Consider aria-labelledby.
Creates a navigation element.
Accessibility: Represents navigation links. Screen readers can jump to navigation. Use aria-label to distinguish multiple nav elements (e.g., “Main navigation”, “Footer links”).
Sourcepub const fn create_aside() -> Self
pub const fn create_aside() -> Self
Creates an aside element.
Accessibility: Represents content tangentially related to main content (sidebars, callouts). Screen readers announce this as complementary content.
Sourcepub const fn create_header() -> Self
pub const fn create_header() -> Self
Creates a header element.
Accessibility: Represents introductory content or navigational aids. Can be used for page headers or section headers.
Creates a footer element.
Accessibility: Represents footer for nearest section or page. Typically contains copyright, author info, or related links.
Sourcepub const fn create_main() -> Self
pub const fn create_main() -> Self
Creates a main content element.
Accessibility: Represents the dominant content. There should be only ONE main per page. Screen readers can jump directly to main content. Do not nest inside article/aside/footer/header/nav.
Sourcepub const fn create_figure() -> Self
pub const fn create_figure() -> Self
Creates a figure element.
Accessibility: Represents self-contained content like diagrams, photos, code listings.
Use with <figcaption> to provide a caption. Screen readers associate caption with figure.
Sourcepub const fn create_figcaption() -> Self
pub const fn create_figcaption() -> Self
Creates a figure caption element.
Accessibility: Provides a caption for <figure>. Screen readers announce this as the
figure description.
Sourcepub const fn create_details() -> Self
pub const fn create_details() -> Self
Creates a details disclosure element.
Accessibility: Creates a disclosure widget. Screen readers announce expanded/collapsed
state. Must contain a <summary> element. Keyboard accessible by default.
Sourcepub fn summary<S: Into<AzString>>(text: S) -> Self
pub fn summary<S: Into<AzString>>(text: S) -> Self
Creates a summary element for details.
Accessibility: The visible heading/label for <details>.
Must be the first child of details. Keyboard accessible (Enter/Space to toggle).
Sourcepub const fn create_dialog() -> Self
pub const fn create_dialog() -> Self
Creates a dialog element.
Accessibility: Represents a modal or non-modal dialog. When opened as modal, focus is trapped. Use aria-label or aria-labelledby. Escape key should close modal dialogs.
pub const fn create_br() -> Self
pub fn create_text<S: Into<AzString>>(value: S) -> Self
pub fn create_image(image: ImageRef) -> Self
Sourcepub fn create_icon<S: Into<AzString>>(icon_name: S) -> Self
pub fn create_icon<S: Into<AzString>>(icon_name: S) -> Self
Creates an icon node with the given icon name.
The icon name should match names from the icon provider (e.g., “home”, “settings”, “search”). Icons are resolved to actual content (font glyph, image, etc.) during StyledDom creation based on the configured IconProvider.
§Example
Dom::create_icon("home")
.with_class("nav-icon")pub fn create_iframe(data: RefAny, callback: impl Into<IFrameCallback>) -> Self
Sourcepub const fn create_p() -> Self
pub const fn create_p() -> Self
Creates a paragraph element.
Accessibility: Paragraphs provide semantic structure for screen readers.
Sourcepub fn h1<S: Into<AzString>>(text: S) -> Self
pub fn h1<S: Into<AzString>>(text: S) -> Self
Creates a heading level 1 element.
Accessibility: Use h1 for the main page title. There should typically be only one h1
per page.
Parameters:
text: Heading text
Sourcepub fn h2<S: Into<AzString>>(text: S) -> Self
pub fn h2<S: Into<AzString>>(text: S) -> Self
Creates a heading level 2 element.
Accessibility: Use h2 for major section headings under h1.
Parameters:
text: Heading text
Sourcepub fn h3<S: Into<AzString>>(text: S) -> Self
pub fn h3<S: Into<AzString>>(text: S) -> Self
Creates a heading level 3 element.
Accessibility: Use h3 for subsections under h2.
Parameters:
text: Heading text
Sourcepub fn h4<S: Into<AzString>>(text: S) -> Self
pub fn h4<S: Into<AzString>>(text: S) -> Self
Creates a heading level 4 element.
Parameters:
text: Heading text
Sourcepub fn h5<S: Into<AzString>>(text: S) -> Self
pub fn h5<S: Into<AzString>>(text: S) -> Self
Creates a heading level 5 element.
Parameters:
text: Heading text
Sourcepub fn h6<S: Into<AzString>>(text: S) -> Self
pub fn h6<S: Into<AzString>>(text: S) -> Self
Creates a heading level 6 element.
Parameters:
text: Heading text
Sourcepub fn span<S: Into<AzString>>(text: S) -> Self
pub fn span<S: Into<AzString>>(text: S) -> Self
Creates a generic inline container (span).
Accessibility: Prefer semantic elements like strong, em, code, etc. when
applicable.
Parameters:
text: Span content
Sourcepub fn strong<S: Into<AzString>>(text: S) -> Self
pub fn strong<S: Into<AzString>>(text: S) -> Self
Creates a strongly emphasized text element (strong importance).
Accessibility: Use strong instead of b for semantic meaning. Screen readers can
convey the importance. Use for text that has strong importance, seriousness, or urgency.
Parameters:
text: Text to emphasize
Sourcepub fn em<S: Into<AzString>>(text: S) -> Self
pub fn em<S: Into<AzString>>(text: S) -> Self
Creates an emphasized text element (stress emphasis).
Accessibility: Use em instead of i for semantic meaning. Screen readers can
convey the emphasis. Use for text that has stress emphasis.
Parameters:
text: Text to emphasize
Sourcepub fn code<S: Into<AzString>>(code: S) -> Self
pub fn code<S: Into<AzString>>(code: S) -> Self
Creates a code/computer code element.
Accessibility: Represents a fragment of computer code. Screen readers can identify this as code content.
Parameters:
code: Code content
Sourcepub fn pre<S: Into<AzString>>(text: S) -> Self
pub fn pre<S: Into<AzString>>(text: S) -> Self
Creates a preformatted text element.
Accessibility: Preserves whitespace and line breaks. Useful for code blocks or ASCII art. Screen readers will read the content as-is.
Parameters:
text: Preformatted content
Sourcepub fn blockquote<S: Into<AzString>>(text: S) -> Self
pub fn blockquote<S: Into<AzString>>(text: S) -> Self
Creates a blockquote element.
Accessibility: Represents a section quoted from another source. Screen readers
can identify quoted content. Consider adding a cite attribute.
Parameters:
text: Quote content
Sourcepub fn cite<S: Into<AzString>>(text: S) -> Self
pub fn cite<S: Into<AzString>>(text: S) -> Self
Creates a citation element.
Accessibility: Represents a reference to a creative work. Screen readers can identify citations.
Parameters:
text: Citation text
Sourcepub fn create_abbr(abbr_text: AzString, title: AzString) -> Self
pub fn create_abbr(abbr_text: AzString, title: AzString) -> Self
Creates an abbreviation element.
Accessibility: Represents an abbreviation or acronym. Use with a title attribute
to provide the full expansion for screen readers.
Parameters:
abbr_text: Abbreviated texttitle: Full expansion
Sourcepub fn kbd<S: Into<AzString>>(text: S) -> Self
pub fn kbd<S: Into<AzString>>(text: S) -> Self
Creates a keyboard input element.
Accessibility: Represents keyboard input or key combinations. Screen readers can identify keyboard instructions.
Parameters:
text: Keyboard instruction
Sourcepub fn samp<S: Into<AzString>>(text: S) -> Self
pub fn samp<S: Into<AzString>>(text: S) -> Self
Creates a sample output element.
Accessibility: Represents sample output from a program or computing system.
Parameters:
text: Sample text
Sourcepub fn var<S: Into<AzString>>(text: S) -> Self
pub fn var<S: Into<AzString>>(text: S) -> Self
Creates a variable element.
Accessibility: Represents a variable in mathematical expressions or programming.
Parameters:
text: Variable name
Sourcepub fn sub<S: Into<AzString>>(text: S) -> Self
pub fn sub<S: Into<AzString>>(text: S) -> Self
Creates a subscript element.
Accessibility: Screen readers may announce subscript formatting.
Parameters:
text: Subscript content
Sourcepub fn sup<S: Into<AzString>>(text: S) -> Self
pub fn sup<S: Into<AzString>>(text: S) -> Self
Creates a superscript element.
Accessibility: Screen readers may announce superscript formatting.
Parameters:
text: Superscript content
Sourcepub fn u<S: Into<AzString>>(text: S) -> Self
pub fn u<S: Into<AzString>>(text: S) -> Self
Creates an underline text element.
Accessibility: Screen readers typically don’t announce underline formatting.
Use semantic elements when possible (e.g., <em> for emphasis).
Sourcepub fn s<S: Into<AzString>>(text: S) -> Self
pub fn s<S: Into<AzString>>(text: S) -> Self
Creates a strikethrough text element.
Accessibility: Represents text that is no longer accurate or relevant.
Consider using <del> for deleted content with datetime attribute.
Sourcepub fn mark<S: Into<AzString>>(text: S) -> Self
pub fn mark<S: Into<AzString>>(text: S) -> Self
Creates a marked/highlighted text element.
Accessibility: Represents text marked for reference or notation purposes. Screen readers may announce this as “highlighted”.
Sourcepub fn del<S: Into<AzString>>(text: S) -> Self
pub fn del<S: Into<AzString>>(text: S) -> Self
Creates a deleted text element.
Accessibility: Represents deleted content in document edits.
Use with datetime and cite attributes for edit tracking.
Sourcepub fn ins<S: Into<AzString>>(text: S) -> Self
pub fn ins<S: Into<AzString>>(text: S) -> Self
Creates an inserted text element.
Accessibility: Represents inserted content in document edits.
Use with datetime and cite attributes for edit tracking.
Sourcepub fn dfn<S: Into<AzString>>(text: S) -> Self
pub fn dfn<S: Into<AzString>>(text: S) -> Self
Creates a definition element.
Accessibility: Represents the defining instance of a term.
Often used within a definition list or with <abbr>.
Sourcepub fn create_time(text: AzString, datetime: OptionString) -> Self
pub fn create_time(text: AzString, datetime: OptionString) -> Self
Creates a time element.
Accessibility: Represents a specific time or date.
Use datetime attribute for machine-readable format.
Parameters:
text: Human-readable time/datedatetime: Optional machine-readable datetime
Sourcepub fn bdo<S: Into<AzString>>(text: S) -> Self
pub fn bdo<S: Into<AzString>>(text: S) -> Self
Creates a bi-directional override element.
Accessibility: Overrides text direction. Use dir attribute (ltr/rtl).
Sourcepub fn create_a(href: AzString, label: OptionString) -> Self
pub fn create_a(href: AzString, label: OptionString) -> Self
Creates an anchor/hyperlink element.
Accessibility: Always provide meaningful link text. Avoid “click here” or “read more”. Screen readers often navigate by links, so descriptive text is crucial.
Parameters:
href: Link destination URLlabel: Link text (passNonefor image-only links with alt text)
Creates a button element.
Accessibility: Buttons are keyboard accessible by default. Always provide clear
button text or an aria-label for icon-only buttons.
Parameters:
text: Button label text
Sourcepub fn create_label(for_id: AzString, text: AzString) -> Self
pub fn create_label(for_id: AzString, text: AzString) -> Self
Creates a label element for form controls.
Accessibility: Always associate labels with form controls using for attribute
or by wrapping the control. This is critical for screen reader users.
Parameters:
for_id: ID of the associated form controltext: Label text
Sourcepub fn create_input(
input_type: AzString,
name: AzString,
label: AzString,
) -> Self
pub fn create_input( input_type: AzString, name: AzString, label: AzString, ) -> Self
Creates an input element.
Accessibility: Always provide a label or aria-label. Set appropriate type
and aria- attributes for the input’s purpose.
Parameters:
input_type: Input type (text, password, email, etc.)name: Form field namelabel: Accessibility label (required)
Sourcepub fn create_textarea(name: AzString, label: AzString) -> Self
pub fn create_textarea(name: AzString, label: AzString) -> Self
Creates a textarea element.
Accessibility: Always provide a label or aria-label. Consider aria-describedby
for additional instructions.
Parameters:
name: Form field namelabel: Accessibility label (required)
Sourcepub fn create_select(name: AzString, label: AzString) -> Self
pub fn create_select(name: AzString, label: AzString) -> Self
Creates a select dropdown element.
Accessibility: Always provide a label. Group related options with optgroup.
Parameters:
name: Form field namelabel: Accessibility label (required)
Sourcepub fn create_option(value: AzString, text: AzString) -> Self
pub fn create_option(value: AzString, text: AzString) -> Self
Creates an option element for select dropdowns.
Parameters:
value: Option valuetext: Display text
Sourcepub fn create_ul() -> Self
pub fn create_ul() -> Self
Creates an unordered list element.
Accessibility: Screen readers announce lists and item counts, helping users understand content structure.
Sourcepub fn create_ol() -> Self
pub fn create_ol() -> Self
Creates an ordered list element.
Accessibility: Screen readers announce lists and item counts, helping users understand content structure and numbering.
Sourcepub fn create_li() -> Self
pub fn create_li() -> Self
Creates a list item element.
Accessibility: Must be a child of ul, ol, or menu. Screen readers announce
list item position (e.g., “2 of 5”).
Sourcepub fn create_table() -> Self
pub fn create_table() -> Self
Creates a table element.
Accessibility: Use proper table structure with thead, tbody, th, and td.
Provide a caption for table purpose. Use scope attribute on header cells.
Sourcepub fn create_caption() -> Self
pub fn create_caption() -> Self
Creates a table caption element.
Accessibility: Describes the purpose of the table. Screen readers announce this first.
Sourcepub fn create_thead() -> Self
pub fn create_thead() -> Self
Creates a table header element.
Accessibility: Groups header rows. Screen readers can navigate table structure.
Sourcepub fn create_tbody() -> Self
pub fn create_tbody() -> Self
Creates a table body element.
Accessibility: Groups body rows. Screen readers can navigate table structure.
Sourcepub fn create_tfoot() -> Self
pub fn create_tfoot() -> Self
Creates a table footer element.
Accessibility: Groups footer rows. Screen readers can navigate table structure.
Sourcepub fn create_th() -> Self
pub fn create_th() -> Self
Creates a table header cell element.
Accessibility: Use scope attribute (“col” or “row”) to associate headers with
data cells. Screen readers use this to announce cell context.
Sourcepub fn create_form() -> Self
pub fn create_form() -> Self
Creates a form element.
Accessibility: Group related form controls with fieldset and legend.
Provide clear labels for all inputs. Consider aria-describedby for instructions.
Sourcepub fn create_fieldset() -> Self
pub fn create_fieldset() -> Self
Creates a fieldset element for grouping form controls.
Accessibility: Groups related form controls. Always include a legend as the
first child to describe the group. Screen readers announce the legend when entering
the fieldset.
Sourcepub fn create_legend() -> Self
pub fn create_legend() -> Self
Creates a legend element for fieldsets.
Accessibility: Describes the purpose of a fieldset. Must be the first child of a fieldset. Screen readers announce this when entering the fieldset.
Sourcepub fn create_hr() -> Self
pub fn create_hr() -> Self
Creates a horizontal rule element.
Accessibility: Represents a thematic break. Screen readers may announce this as a separator. Consider using CSS borders for purely decorative lines.
Sourcepub const fn create_address() -> Self
pub const fn create_address() -> Self
Creates an address element.
Accessibility: Represents contact information. Screen readers identify this as address content.
Sourcepub const fn create_dl() -> Self
pub const fn create_dl() -> Self
Creates a definition list element.
Accessibility: Screen readers announce definition lists and their structure.
Sourcepub const fn create_dt() -> Self
pub const fn create_dt() -> Self
Creates a definition term element.
Accessibility: Must be a child of dl. Represents the term being defined.
Sourcepub const fn create_dd() -> Self
pub const fn create_dd() -> Self
Creates a definition description element.
Accessibility: Must be a child of dl. Provides the definition for the term.
Sourcepub const fn create_colgroup() -> Self
pub const fn create_colgroup() -> Self
Creates a table column group element.
Sourcepub fn create_col(span: i32) -> Self
pub fn create_col(span: i32) -> Self
Creates a table column element.
Sourcepub fn create_optgroup(label: AzString) -> Self
pub fn create_optgroup(label: AzString) -> Self
Creates an optgroup element for grouping select options.
Parameters:
label: Label for the option group
Sourcepub const fn create_q() -> Self
pub const fn create_q() -> Self
Creates a quotation element.
Accessibility: Represents an inline quotation.
Sourcepub const fn acronym() -> Self
pub const fn acronym() -> Self
Creates an acronym element.
Note: Deprecated in HTML5. Consider using abbr() instead.
Creates a menu element.
Accessibility: Represents a list of commands. Similar to <ul> but semantic for
toolbars/menus.
Creates a menu item element.
Accessibility: Represents a command in a menu. Use with appropriate role/aria attributes.
Sourcepub const fn create_output() -> Self
pub const fn create_output() -> Self
Creates an output element.
Accessibility: Represents the result of a calculation or user action.
Use for attribute to associate with input elements. Screen readers announce updates.
Sourcepub fn create_progress(value: f32, max: f32) -> Self
pub fn create_progress(value: f32, max: f32) -> Self
Creates a progress indicator element.
Accessibility: Represents task progress. Use value and max attributes.
Screen readers announce progress percentage. Use aria-label to describe the task.
Sourcepub fn create_meter(value: f32, min: f32, max: f32) -> Self
pub fn create_meter(value: f32, min: f32, max: f32) -> Self
Creates a meter gauge element.
Accessibility: Represents a scalar measurement within a known range.
Use value, min, max, low, high, optimum attributes.
Screen readers announce the measurement. Provide aria-label for context.
Sourcepub const fn create_datalist() -> Self
pub const fn create_datalist() -> Self
Creates a datalist element for input suggestions.
Accessibility: Provides autocomplete options for inputs.
Associate with input using list attribute. Screen readers announce available options.
Sourcepub const fn create_canvas() -> Self
pub const fn create_canvas() -> Self
Creates a canvas element for graphics.
Accessibility: Canvas content is not accessible by default. Always provide fallback content as children and/or detailed aria-label. Consider using SVG for accessible graphics when possible.
Sourcepub const fn create_object() -> Self
pub const fn create_object() -> Self
Creates an object element for embedded content.
Accessibility: Provide fallback content as children. Use aria-label to describe content.
Sourcepub fn create_param(name: AzString, value: AzString) -> Self
pub fn create_param(name: AzString, value: AzString) -> Self
Creates a param element for object parameters.
Parameters:
name: Parameter namevalue: Parameter value
Sourcepub const fn create_embed() -> Self
pub const fn create_embed() -> Self
Creates an embed element.
Accessibility: Provide alternative content or link. Use aria-label to describe embedded content.
Sourcepub const fn create_audio() -> Self
pub const fn create_audio() -> Self
Creates an audio element.
Accessibility: Always provide controls. Use <track> for captions/subtitles.
Provide fallback text for unsupported browsers.
Sourcepub const fn create_video() -> Self
pub const fn create_video() -> Self
Creates a video element.
Accessibility: Always provide controls. Use <track> for
captions/subtitles/descriptions. Provide fallback text. Consider providing transcript.
Sourcepub fn create_source(src: AzString, media_type: AzString) -> Self
pub fn create_source(src: AzString, media_type: AzString) -> Self
Creates a source element for media.
Parameters:
src: Media source URLmedia_type: MIME type (e.g., “video/mp4”, “audio/ogg”)
Sourcepub fn create_track(src: AzString, kind: AzString) -> Self
pub fn create_track(src: AzString, kind: AzString) -> Self
Creates a track element for media captions/subtitles.
Accessibility: Essential for deaf/hard-of-hearing users and non-native speakers.
Use kind (subtitles/captions/descriptions), srclang, and label attributes.
Parameters:
src: Track file URL (WebVTT format)kind: Track kind (“subtitles”, “captions”, “descriptions”, “chapters”, “metadata”)
Sourcepub const fn create_map() -> Self
pub const fn create_map() -> Self
Creates a map element for image maps.
Accessibility: Provide text alternatives. Ensure all areas have alt text.
Sourcepub const fn create_area() -> Self
pub const fn create_area() -> Self
Creates an area element for image map regions.
Accessibility: Always provide alt text describing the region/link purpose.
Keyboard users should be able to navigate areas.
Sourcepub fn title<S: Into<AzString>>(text: S) -> Self
pub fn title<S: Into<AzString>>(text: S) -> Self
Creates a title element for document title.
Accessibility: Required for all pages. Screen readers announce this first. Should be unique and descriptive. Keep under 60 characters.
Sourcepub const fn meta() -> Self
pub const fn meta() -> Self
Creates a meta element.
Accessibility: Use for charset, viewport, description. Crucial for proper text display.
Sourcepub const fn create_link() -> Self
pub const fn create_link() -> Self
Creates a link element for external resources.
Accessibility: Use for stylesheets, icons, alternate versions.
Provide meaningful title attribute for alternate stylesheets.
Sourcepub const fn create_script() -> Self
pub const fn create_script() -> Self
Creates a script element.
Accessibility: Ensure scripted content is accessible. Provide noscript fallbacks for critical functionality.
Sourcepub const fn style_element() -> Self
pub const fn style_element() -> Self
Creates a style element for embedded CSS.
Note: In Azul, use the .style() method instead for styling.
This creates a <style> HTML element for embedded stylesheets.
Sourcepub fn base(href: AzString) -> Self
pub fn base(href: AzString) -> Self
Creates a base element for document base URL.
Parameters:
href: Base URL for relative URLs in the document
Sourcepub fn th_with_scope(scope: AzString, text: AzString) -> Self
pub fn th_with_scope(scope: AzString, text: AzString) -> Self
Creates a table header cell with scope.
Parameters:
scope: “col”, “row”, “colgroup”, or “rowgroup”text: Header text
Accessibility: The scope attribute is crucial for associating headers with data cells.
Sourcepub fn td_with_text<S: Into<AzString>>(text: S) -> Self
pub fn td_with_text<S: Into<AzString>>(text: S) -> Self
Creates a table data cell with text.
Parameters:
text: Cell content
Sourcepub fn th_with_text<S: Into<AzString>>(text: S) -> Self
pub fn th_with_text<S: Into<AzString>>(text: S) -> Self
Creates a table header cell with text.
Parameters:
text: Header text
Sourcepub fn li_with_text<S: Into<AzString>>(text: S) -> Self
pub fn li_with_text<S: Into<AzString>>(text: S) -> Self
Creates a list item with text.
Parameters:
text: List item content
Sourcepub fn p_with_text<S: Into<AzString>>(text: S) -> Self
pub fn p_with_text<S: Into<AzString>>(text: S) -> Self
Creates a paragraph with text.
Parameters:
text: Paragraph content
Creates a button with text content and accessibility information.
Parameters:
text: The visible button textaria: Accessibility information (role, description, etc.)
Sourcepub fn link_with_aria<S1: Into<AzString>, S2: Into<AzString>>(
href: S1,
text: S2,
aria: SmallAriaInfo,
) -> Self
pub fn link_with_aria<S1: Into<AzString>, S2: Into<AzString>>( href: S1, text: S2, aria: SmallAriaInfo, ) -> Self
Creates a link (anchor) with href, text, and accessibility information.
Parameters:
href: The link destinationtext: The visible link textaria: Accessibility information (expanded description, etc.)
Sourcepub fn input_with_aria<S1: Into<AzString>, S2: Into<AzString>, S3: Into<AzString>>(
input_type: S1,
name: S2,
label: S3,
aria: SmallAriaInfo,
) -> Self
pub fn input_with_aria<S1: Into<AzString>, S2: Into<AzString>, S3: Into<AzString>>( input_type: S1, name: S2, label: S3, aria: SmallAriaInfo, ) -> Self
Creates an input element with type, name, and accessibility information.
Parameters:
input_type: The input type (text, password, email, etc.)name: The form field namelabel: Base accessibility labelaria: Additional accessibility information (description, etc.)
Sourcepub fn textarea_with_aria<S1: Into<AzString>, S2: Into<AzString>>(
name: S1,
label: S2,
aria: SmallAriaInfo,
) -> Self
pub fn textarea_with_aria<S1: Into<AzString>, S2: Into<AzString>>( name: S1, label: S2, aria: SmallAriaInfo, ) -> Self
Creates a textarea with name and accessibility information.
Parameters:
name: The form field namelabel: Base accessibility labelaria: Additional accessibility information (description, etc.)
Sourcepub fn select_with_aria<S1: Into<AzString>, S2: Into<AzString>>(
name: S1,
label: S2,
aria: SmallAriaInfo,
) -> Self
pub fn select_with_aria<S1: Into<AzString>, S2: Into<AzString>>( name: S1, label: S2, aria: SmallAriaInfo, ) -> Self
Creates a select dropdown with name and accessibility information.
Parameters:
name: The form field namelabel: Base accessibility labelaria: Additional accessibility information (description, etc.)
Sourcepub fn table_with_aria<S: Into<AzString>>(
caption: S,
aria: SmallAriaInfo,
) -> Self
pub fn table_with_aria<S: Into<AzString>>( caption: S, aria: SmallAriaInfo, ) -> Self
Creates a table with caption and accessibility information.
Parameters:
caption: Table caption (visible title)aria: Accessibility information describing table purpose
Sourcepub fn label_with_aria<S1: Into<AzString>, S2: Into<AzString>>(
for_id: S1,
text: S2,
aria: SmallAriaInfo,
) -> Self
pub fn label_with_aria<S1: Into<AzString>, S2: Into<AzString>>( for_id: S1, text: S2, aria: SmallAriaInfo, ) -> Self
Creates a label for a form control with additional accessibility information.
Parameters:
for_id: The ID of the associated form controltext: The visible label textaria: Additional accessibility information (description, etc.)
Sourcepub fn from_xml<S: AsRef<str>>(xml_str: S) -> Self
pub fn from_xml<S: AsRef<str>>(xml_str: S) -> Self
Parse XML/XHTML string into a DOM (fallback without xml feature)
pub fn swap_with_default(&mut self) -> Self
pub fn add_child(&mut self, child: Dom)
pub fn set_children(&mut self, children: DomVec)
pub fn copy_except_for_root(&mut self) -> Self
pub fn node_count(&self) -> usize
pub fn style(&mut self, css: Css) -> StyledDom
pub fn with_children(self, children: DomVec) -> Self
pub fn with_child(self, child: Self) -> Self
pub fn with_node_type(self, node_type: NodeType) -> Self
pub fn with_id(self, id: AzString) -> Self
pub fn with_class(self, class: AzString) -> Self
pub fn with_callback<C: Into<CoreCallback>>( self, event: EventFilter, data: RefAny, callback: C, ) -> Self
pub fn with_css_property(self, prop: CssProperty) -> Self
pub fn with_hover_css_property(self, prop: CssProperty) -> Self
pub fn with_active_css_property(self, prop: CssProperty) -> Self
pub fn with_focus_css_property(self, prop: CssProperty) -> Self
pub fn with_tab_index(self, tab_index: TabIndex) -> Self
pub fn with_contenteditable(self, contenteditable: bool) -> Self
pub fn with_dataset(self, data: OptionRefAny) -> Self
pub fn with_ids_and_classes(self, ids_and_classes: IdOrClassVec) -> Self
Sourcepub fn with_attribute(self, attr: AttributeType) -> Self
pub fn with_attribute(self, attr: AttributeType) -> Self
Adds an attribute to this DOM element.
Sourcepub fn with_attributes(self, attributes: AttributeVec) -> Self
pub fn with_attributes(self, attributes: AttributeVec) -> Self
Adds multiple attributes to this DOM element.
pub fn with_callbacks(self, callbacks: CoreCallbackDataVec) -> Self
pub fn with_css_props(self, css_props: CssPropertyWithConditionsVec) -> Self
Sourcepub fn with_key<K: Hash>(self, key: K) -> Self
pub fn with_key<K: Hash>(self, key: K) -> Self
Assigns a stable key to the root node of this DOM for reconciliation.
This is crucial for performance and correct state preservation when lists of items change order or items are inserted/removed.
§Example
Dom::create_div()
.with_key("user-avatar-123")Sourcepub fn with_merge_callback<C: Into<DatasetMergeCallback>>(
self,
callback: C,
) -> Self
pub fn with_merge_callback<C: Into<DatasetMergeCallback>>( self, callback: C, ) -> Self
Registers a callback to merge dataset state from the previous frame.
This is used for components that maintain heavy internal state (video players, WebGL contexts, network connections) that should not be destroyed and recreated on every render frame.
The callback receives both datasets as RefAny (cheap shallow clones) and
returns the RefAny that should be used for the new node.
pub fn set_inline_style(&mut self, style: &str)
pub fn with_inline_style(self, style: &str) -> Self
Sourcepub fn set_inline_hover_style(&mut self, style: &str)
pub fn set_inline_hover_style(&mut self, style: &str)
Sets inline CSS styles for the hover state on the root node
Sourcepub fn with_inline_hover_style(self, style: &str) -> Self
pub fn with_inline_hover_style(self, style: &str) -> Self
Builder method for setting inline CSS styles for the hover state
Sourcepub fn set_inline_active_style(&mut self, style: &str)
pub fn set_inline_active_style(&mut self, style: &str)
Sets inline CSS styles for the active state on the root node
Sourcepub fn with_inline_active_style(self, style: &str) -> Self
pub fn with_inline_active_style(self, style: &str) -> Self
Builder method for setting inline CSS styles for the active state
Sourcepub fn set_inline_focus_style(&mut self, style: &str)
pub fn set_inline_focus_style(&mut self, style: &str)
Sets inline CSS styles for the focus state on the root node
Sourcepub fn with_inline_focus_style(self, style: &str) -> Self
pub fn with_inline_focus_style(self, style: &str) -> Self
Builder method for setting inline CSS styles for the focus state
Sets the context menu for the root node
Sets the menu bar for the root node
pub fn with_clip_mask(self, clip_mask: ImageMask) -> Self
pub fn with_accessibility_info( self, accessibility_info: AccessibilityInfo, ) -> Self
pub fn fixup_children_estimated(&mut self) -> usize
Trait Implementations§
Source§impl Extend<Dom> for DomVec
impl Extend<Dom> for DomVec
Source§fn extend<T: IntoIterator<Item = Dom>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Dom>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl From<Dom> for CompactDom
impl From<Dom> for CompactDom
Source§impl FromIterator<Dom> for Dom
impl FromIterator<Dom> for Dom
Source§impl FromIterator<Dom> for DomVec
impl FromIterator<Dom> for DomVec
Source§impl Ord for Dom
impl Ord for Dom
Source§impl PartialOrd for Dom
impl PartialOrd for Dom
impl Eq for Dom
impl StructuralPartialEq for Dom
Auto Trait Implementations§
impl Freeze for Dom
impl RefUnwindSafe for Dom
impl Send for Dom
impl Sync for Dom
impl Unpin for Dom
impl UnwindSafe for Dom
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more