Skip to main content

Dom

Struct Dom 

Source
#[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: NodeData

The data for the root node of this DOM (or sub-DOM).

§children: DomVec

The children of this DOM node.

§estimated_total_children: usize

Implementations§

Source§

impl Dom

Source

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.

Source

pub fn from_data(node_data: NodeData) -> Self

Source

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.

Source

pub const fn create_head() -> Self

Creates the document head element.

Accessibility: The <head> contains metadata. Use <title> for page titles.

Source

pub const fn create_body() -> Self

Source

pub const fn create_div() -> Self

Creates a generic block-level container.

Accessibility: Prefer semantic elements like <article>, <section>, <nav> when applicable.

Source

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.

Source

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.

Source

pub const fn create_nav() -> Self

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”).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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).

Source

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.

Source

pub const fn create_br() -> Self

Source

pub fn create_text<S: Into<AzString>>(value: S) -> Self

Source

pub fn create_image(image: ImageRef) -> Self

Source

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")
Source

pub fn create_iframe(data: RefAny, callback: impl Into<IFrameCallback>) -> Self

Source

pub const fn create_p() -> Self

Creates a paragraph element.

Accessibility: Paragraphs provide semantic structure for screen readers.

Source

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
Source

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
Source

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
Source

pub fn h4<S: Into<AzString>>(text: S) -> Self

Creates a heading level 4 element.

Parameters:

  • text: Heading text
Source

pub fn h5<S: Into<AzString>>(text: S) -> Self

Creates a heading level 5 element.

Parameters:

  • text: Heading text
Source

pub fn h6<S: Into<AzString>>(text: S) -> Self

Creates a heading level 6 element.

Parameters:

  • text: Heading text
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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 text
  • title: Full expansion
Source

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
Source

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
Source

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
Source

pub fn sub<S: Into<AzString>>(text: S) -> Self

Creates a subscript element.

Accessibility: Screen readers may announce subscript formatting.

Parameters:

  • text: Subscript content
Source

pub fn sup<S: Into<AzString>>(text: S) -> Self

Creates a superscript element.

Accessibility: Screen readers may announce superscript formatting.

Parameters:

  • text: Superscript content
Source

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).

Source

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.

Source

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”.

Source

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.

Source

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.

Source

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>.

Source

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/date
  • datetime: Optional machine-readable datetime
Source

pub fn bdo<S: Into<AzString>>(text: S) -> Self

Creates a bi-directional override element.

Accessibility: Overrides text direction. Use dir attribute (ltr/rtl).

Source

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 URL
  • label: Link text (pass None for image-only links with alt text)
Source

pub fn create_button(text: AzString) -> Self

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
Source

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 control
  • text: Label text
Source

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 name
  • label: Accessibility label (required)
Source

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 name
  • label: Accessibility label (required)
Source

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 name
  • label: Accessibility label (required)
Source

pub fn create_option(value: AzString, text: AzString) -> Self

Creates an option element for select dropdowns.

Parameters:

  • value: Option value
  • text: Display text
Source

pub fn create_ul() -> Self

Creates an unordered list element.

Accessibility: Screen readers announce lists and item counts, helping users understand content structure.

Source

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.

Source

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”).

Source

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.

Source

pub fn create_caption() -> Self

Creates a table caption element.

Accessibility: Describes the purpose of the table. Screen readers announce this first.

Source

pub fn create_thead() -> Self

Creates a table header element.

Accessibility: Groups header rows. Screen readers can navigate table structure.

Source

pub fn create_tbody() -> Self

Creates a table body element.

Accessibility: Groups body rows. Screen readers can navigate table structure.

Source

pub fn create_tfoot() -> Self

Creates a table footer element.

Accessibility: Groups footer rows. Screen readers can navigate table structure.

Source

pub fn create_tr() -> Self

Creates a table row element.

Source

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.

Source

pub fn create_td() -> Self

Creates a table data cell element.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub const fn create_address() -> Self

Creates an address element.

Accessibility: Represents contact information. Screen readers identify this as address content.

Source

pub const fn create_dl() -> Self

Creates a definition list element.

Accessibility: Screen readers announce definition lists and their structure.

Source

pub const fn create_dt() -> Self

Creates a definition term element.

Accessibility: Must be a child of dl. Represents the term being defined.

Source

pub const fn create_dd() -> Self

Creates a definition description element.

Accessibility: Must be a child of dl. Provides the definition for the term.

Source

pub const fn create_colgroup() -> Self

Creates a table column group element.

Source

pub fn create_col(span: i32) -> Self

Creates a table column element.

Source

pub fn create_optgroup(label: AzString) -> Self

Creates an optgroup element for grouping select options.

Parameters:

  • label: Label for the option group
Source

pub const fn create_q() -> Self

Creates a quotation element.

Accessibility: Represents an inline quotation.

Source

pub const fn acronym() -> Self

Creates an acronym element.

Note: Deprecated in HTML5. Consider using abbr() instead.

Source

pub const fn create_menu() -> Self

Creates a menu element.

Accessibility: Represents a list of commands. Similar to <ul> but semantic for toolbars/menus.

Source

pub const fn menuitem() -> Self

Creates a menu item element.

Accessibility: Represents a command in a menu. Use with appropriate role/aria attributes.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn create_param(name: AzString, value: AzString) -> Self

Creates a param element for object parameters.

Parameters:

  • name: Parameter name
  • value: Parameter value
Source

pub const fn create_embed() -> Self

Creates an embed element.

Accessibility: Provide alternative content or link. Use aria-label to describe embedded content.

Source

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.

Source

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.

Source

pub fn create_source(src: AzString, media_type: AzString) -> Self

Creates a source element for media.

Parameters:

  • src: Media source URL
  • media_type: MIME type (e.g., “video/mp4”, “audio/ogg”)
Source

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”)
Source

pub const fn create_map() -> Self

Creates a map element for image maps.

Accessibility: Provide text alternatives. Ensure all areas have alt text.

Source

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.

Source

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.

Source

pub const fn meta() -> Self

Creates a meta element.

Accessibility: Use for charset, viewport, description. Crucial for proper text display.

Creates a link element for external resources.

Accessibility: Use for stylesheets, icons, alternate versions. Provide meaningful title attribute for alternate stylesheets.

Source

pub const fn create_script() -> Self

Creates a script element.

Accessibility: Ensure scripted content is accessible. Provide noscript fallbacks for critical functionality.

Source

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.

Source

pub fn base(href: AzString) -> Self

Creates a base element for document base URL.

Parameters:

  • href: Base URL for relative URLs in the document
Source

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.

Source

pub fn td_with_text<S: Into<AzString>>(text: S) -> Self

Creates a table data cell with text.

Parameters:

  • text: Cell content
Source

pub fn th_with_text<S: Into<AzString>>(text: S) -> Self

Creates a table header cell with text.

Parameters:

  • text: Header text
Source

pub fn li_with_text<S: Into<AzString>>(text: S) -> Self

Creates a list item with text.

Parameters:

  • text: List item content
Source

pub fn p_with_text<S: Into<AzString>>(text: S) -> Self

Creates a paragraph with text.

Parameters:

  • text: Paragraph content
Source

pub fn button_with_aria<S: Into<AzString>>(text: S, aria: SmallAriaInfo) -> Self

Creates a button with text content and accessibility information.

Parameters:

  • text: The visible button text
  • aria: Accessibility information (role, description, etc.)

Creates a link (anchor) with href, text, and accessibility information.

Parameters:

  • href: The link destination
  • text: The visible link text
  • aria: Accessibility information (expanded description, etc.)
Source

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 name
  • label: Base accessibility label
  • aria: Additional accessibility information (description, etc.)
Source

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 name
  • label: Base accessibility label
  • aria: Additional accessibility information (description, etc.)
Source

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 name
  • label: Base accessibility label
  • aria: Additional accessibility information (description, etc.)
Source

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
Source

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 control
  • text: The visible label text
  • aria: Additional accessibility information (description, etc.)
Source

pub fn from_xml<S: AsRef<str>>(xml_str: S) -> Self

Parse XML/XHTML string into a DOM (fallback without xml feature)

Source

pub fn swap_with_default(&mut self) -> Self

Source

pub fn add_child(&mut self, child: Dom)

Source

pub fn set_children(&mut self, children: DomVec)

Source

pub fn copy_except_for_root(&mut self) -> Self

Source

pub fn node_count(&self) -> usize

Source

pub fn style(&mut self, css: Css) -> StyledDom

Source

pub fn with_children(self, children: DomVec) -> Self

Source

pub fn with_child(self, child: Self) -> Self

Source

pub fn with_node_type(self, node_type: NodeType) -> Self

Source

pub fn with_id(self, id: AzString) -> Self

Source

pub fn with_class(self, class: AzString) -> Self

Source

pub fn with_callback<C: Into<CoreCallback>>( self, event: EventFilter, data: RefAny, callback: C, ) -> Self

Source

pub fn with_css_property(self, prop: CssProperty) -> Self

Source

pub fn with_hover_css_property(self, prop: CssProperty) -> Self

Source

pub fn with_active_css_property(self, prop: CssProperty) -> Self

Source

pub fn with_focus_css_property(self, prop: CssProperty) -> Self

Source

pub fn with_tab_index(self, tab_index: TabIndex) -> Self

Source

pub fn with_contenteditable(self, contenteditable: bool) -> Self

Source

pub fn with_dataset(self, data: OptionRefAny) -> Self

Source

pub fn with_ids_and_classes(self, ids_and_classes: IdOrClassVec) -> Self

Source

pub fn with_attribute(self, attr: AttributeType) -> Self

Adds an attribute to this DOM element.

Source

pub fn with_attributes(self, attributes: AttributeVec) -> Self

Adds multiple attributes to this DOM element.

Source

pub fn with_callbacks(self, callbacks: CoreCallbackDataVec) -> Self

Source

pub fn with_css_props(self, css_props: CssPropertyWithConditionsVec) -> Self

Source

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")
Source

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.

Source

pub fn set_inline_style(&mut self, style: &str)

Source

pub fn with_inline_style(self, style: &str) -> Self

Source

pub fn set_inline_hover_style(&mut self, style: &str)

Sets inline CSS styles for the hover state on the root node

Source

pub fn with_inline_hover_style(self, style: &str) -> Self

Builder method for setting inline CSS styles for the hover state

Source

pub fn set_inline_active_style(&mut self, style: &str)

Sets inline CSS styles for the active state on the root node

Source

pub fn with_inline_active_style(self, style: &str) -> Self

Builder method for setting inline CSS styles for the active state

Source

pub fn set_inline_focus_style(&mut self, style: &str)

Sets inline CSS styles for the focus state on the root node

Source

pub fn with_inline_focus_style(self, style: &str) -> Self

Builder method for setting inline CSS styles for the focus state

Source

pub fn set_context_menu(&mut self, context_menu: Menu)

Sets the context menu for the root node

Source

pub fn with_context_menu(self, context_menu: Menu) -> Self

Source

pub fn set_menu_bar(&mut self, menu_bar: Menu)

Sets the menu bar for the root node

Source

pub fn with_menu_bar(self, menu_bar: Menu) -> Self

Source

pub fn with_clip_mask(self, clip_mask: ImageMask) -> Self

Source

pub fn with_accessibility_info( self, accessibility_info: AccessibilityInfo, ) -> Self

Source

pub fn fixup_children_estimated(&mut self) -> usize

Trait Implementations§

Source§

impl Clone for Dom

Source§

fn clone(&self) -> Dom

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Dom

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Extend<Dom> for DomVec

Source§

fn extend<T: IntoIterator<Item = Dom>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl From<Dom> for CompactDom

Source§

fn from(dom: Dom) -> Self

Converts to this type from the input type.
Source§

impl FromIterator<Dom> for Dom

Source§

fn from_iter<I: IntoIterator<Item = Dom>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<Dom> for DomVec

Source§

fn from_iter<T>(iter: T) -> Self
where T: IntoIterator<Item = Dom>,

Creates a value from an iterator. Read more
Source§

impl Hash for Dom

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Dom

Source§

fn cmp(&self, other: &Dom) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Dom

Source§

fn eq(&self, other: &Dom) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Dom

Source§

fn partial_cmp(&self, other: &Dom) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for Dom

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> GetHash for T
where T: Hash,

Source§

fn get_hash(&self) -> u64

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.