[][src]Struct seed::dom_types::El

pub struct El<Ms: '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<Node>,
    pub raw_html: bool,
    pub text_node: bool,
    pub namespace: Option<Namespace>,
    pub controlled: bool,
    pub hooks: LifecycleHooks,
}

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<Node>raw_html: booltext_node: boolnamespace: Option<Namespace>controlled: boolhooks: LifecycleHooks

Methods

impl<Ms> El<Ms>[src]

pub fn empty(tag: Tag) -> Self[src]

Create an empty element, specifying only the tag

pub fn new_text(text: &str) -> Self[src]

pub fn empty_svg(tag: Tag) -> Self[src]

Create an empty SVG element, specifying only the tag

pub fn from_markdown(markdown: &str) -> Self[src]

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

pub fn from_html(html: &str) -> Self[src]

Create an element that will display raw HTML

pub fn add_child(&mut self, element: El<Ms>)[src]

Add a new child to the element

pub fn add_attr(&mut self, key: String, val: String)[src]

Add an attribute (eg class, or href)

pub fn add_style(&mut self, key: String, val: String)[src]

Add a new style (eg display, or height)

pub fn set_text(&mut self, text: &str)[src]

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

pub fn quick_clone(&self) -> Self[src]

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

pub fn get_text(&self) -> String[src]

pub fn is_dummy(&self) -> bool[src]

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

impl<Ms: Clone> UpdateEl<El<Ms>> for Attrs[src]

impl<Ms: Clone, '_> UpdateEl<El<Ms>> for &'_ Attrs[src]

impl<Ms: Clone> UpdateEl<El<Ms>> for Style[src]

impl<Ms: Clone, '_> UpdateEl<El<Ms>> for &'_ Style[src]

impl<Ms: Clone> UpdateEl<El<Ms>> for Listener<Ms>[src]

impl<Ms: Clone> UpdateEl<El<Ms>> for Vec<Listener<Ms>>[src]

impl<Ms: Clone> UpdateEl<El<Ms>> for DidMount[src]

impl<Ms: Clone> UpdateEl<El<Ms>> for DidUpdate[src]

impl<Ms: Clone> UpdateEl<El<Ms>> for WillUnmount[src]

impl<Ms: Clone, '_> UpdateEl<El<Ms>> for &'_ str[src]

impl<Ms: Clone> UpdateEl<El<Ms>> for Vec<El<Ms>>[src]

impl<Ms: Clone> UpdateEl<El<Ms>> for El<Ms>[src]

impl<Ms: Clone> UpdateEl<El<Ms>> for Tag[src]

This is intended only to be used for the custom! element macro.

impl<Ms> Clone for El<Ms>[src]

Allow the user to clone their Els. Note that there's no easy way to clone the closures within listeners or lifestyle hooks, so we ommit them.

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<Ms> PartialEq<El<Ms>> for El<Ms>[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl<Ms: Debug + 'static> Debug for El<Ms>[src]

Auto Trait Implementations

impl<Ms> !Send for El<Ms>

impl<Ms> !Sync for El<Ms>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]