[−][src]Struct seed::dom_types::El
An component in our virtual DOM.
Fields
tag: Tag
attrs: Attrs
style: Style
listeners: Vec<Listener<Ms>>
text: Option<String>
children: Vec<El<Ms>>
id: Option<u32>
nest_level: Option<u32>
el_ws: Option<Node>
raw_html: bool
text_node: bool
namespace: Option<Namespace>
did_mount: Option<Box<dyn FnMut(&Node)>>
did_update: Option<Box<dyn FnMut(&Node)>>
will_unmount: Option<Box<dyn FnMut(&Node)>>
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 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(&self) -> Self
[src]
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]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,