pub struct El<Ms: Clone + 'static> {
pub tag: Tag,
pub attrs: Attrs,
pub style: Style,
pub text: Option<String>,
pub children: Vec<El<Ms>>,
pub id: Option<u32>,
pub nest_level: Option<u32>,
pub el_ws: Option<Element>,
pub key: Option<u32>,
pub listeners: Vec<Listener<Ms>>,
}
Expand description
The Element component of our virtual DOM.
Fields
tag: Tag
attrs: Attrs
style: Style
text: Option<String>
children: Vec<El<Ms>>
id: Option<u32>
nest_level: Option<u32>
el_ws: Option<Element>
key: Option<u32>
listeners: Vec<Listener<Ms>>
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>>
) -> Self
pub fn empty(tag: Tag) -> Self
pub fn add_child(&mut self, element: El<Ms>)
pub fn add_attr(&mut self, key: String, val: String)
pub fn add_style(&mut self, key: String, val: String)
pub fn set_text(&mut self, text: &str)
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