wip: move to slab

This commit is contained in:
Jonathan Kelley committed 2021-07-23 17:03:51 -04:00
1 parent f644d7c441
commit 6084fbcd11
7 files changed
+159 -170

No files matched your search

+7 -6
View File
@@ -17,17 +17,18 @@ use std::{
pub struct VNode<'src> {
pub kind: VNodeKind<'src>,
///
/// ElementId supports NonZero32 and Cell is zero cost, so the size of this field is unaffected
///
///
pub(crate) dom_id: Cell<Option<ElementId>>,
pub(crate) key: Option<&'src str>,
/// ElementId supports NonZero32 and Cell is zero cost, so the size of this field is unaffected
pub(crate) dom_id: Cell<Option<ElementId>>,
}
impl VNode<'_> {
fn key(&self) -> Option<&str> {
pub fn key(&self) -> Option<&str> {
self.key
}
pub fn element_id(&self) -> Option<ElementId> {
self.dom_id.get()
}
}
/// Tools for the base unit of the virtual dom - the VNode