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 namespace: Option<Namespace>,
pub id: Option<u32>,
pub nest_level: Option<u32>,
pub el_ws: Option<Element>,
pub raw_html: bool,
}
Expand description
An component in our virtual DOM.
Fields
tag: Tag
attrs: Attrs
style: Style
listeners: Vec<Listener<Ms>>
text: Option<String>
children: Vec<El<Ms>>
namespace: Option<Namespace>
id: Option<u32>
nest_level: Option<u32>
el_ws: Option<Element>
raw_html: bool
Implementations
sourceimpl<Ms: Clone + 'static> El<Ms>
impl<Ms: Clone + 'static> El<Ms>
pub fn new(
tag: Tag,
attrs: Attrs,
style: Style,
listeners: Vec<Listener<Ms>>,
text: &str,
children: Vec<El<Ms>>,
namespace: Option<Namespace>
) -> Self
sourcepub fn from_markdown(markdown: &str) -> Self
pub fn from_markdown(markdown: &str) -> Self
Create an element that will display markdown from the text you pass to it, as HTML
sourcepub fn set_text(&mut self, text: &str)
pub fn set_text(&mut self, text: &str)
Replace the element’s text node. (ie between the HTML tags)
sourcepub fn quick_clone(&self) -> Self
pub fn quick_clone(&self) -> Self
This is used to provide access to el_ws while recursively appending children to it.
Trait Implementations
sourceimpl<Ms: Clone + 'static> Clone for El<Ms>
impl<Ms: Clone + 'static> Clone for El<Ms>
Allow the user to clone their Els. Note that there’s no easy way to clone the closures within listeners, so we ommit it.
Auto Trait Implementations
impl<Ms> !RefUnwindSafe for El<Ms>
impl<Ms> !Send for El<Ms>
impl<Ms> !Sync for El<Ms>
impl<Ms> Unpin for El<Ms>
impl<Ms> !UnwindSafe for El<Ms>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more