Struct seed::dom_types::El

source ·
pub struct El<Ms: Clone + 'static> {
    pub tag: Tag,
    pub attrs: Attrs,
    pub style: Style,
    pub listeners: Vec<Listener<Ms>>,
    pub text: Option<String>,
    pub children: Vec<El<Ms>>,
    pub id: Option<u32>,
    pub nest_level: Option<u32>,
    pub el_ws: Option<Element>,
    pub markdown: bool,
}
Expand description

An component in our virtual DOM.

Fields

tag: Tagattrs: Attrsstyle: Stylelisteners: Vec<Listener<Ms>>text: Option<String>children: Vec<El<Ms>>id: Option<u32>nest_level: Option<u32>el_ws: Option<Element>markdown: bool

Implementations

Create an empty element, specifying only the tag

Create an element that will display markdown from the text you pass to it, as HTML

Add a new child to the element

Add an attribute (eg class, or href)

Add a new style (eg display, or height)

Replace the element’s text node. (ie between the HTML tags)

This is used to provide access to el_ws while recursively appending children to it.

Dummy elements are used when logic must return an El due to the type system, but we don’t want to render anything.

Trait Implementations

Allow the user to clone their Els. Note that there’s no easy way to clone the closures within listeners, so we ommit it.

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.