make the macro compile

This commit is contained in:
Evan Almloff committed 2022-12-03 19:35:37 -06:00
1 parent 53094a7bbd
commit 29a61b1855
8 files changed
+1092 -1112

No files matched your search

+3 -1
View File
@@ -1,7 +1,9 @@
use std::hash::BuildHasherDefault;
pub use node_ref::NodeMask;
pub use passes::AnyPass;
use rustc_hash::FxHasher;
use tree::NodeId;
pub use tree::NodeId;
pub mod layout_attributes;
pub mod node;
+16 -2
View File
@@ -1,6 +1,6 @@
use dioxus_core::{ElementId, Mutations, TemplateNode};
use rustc_hash::{FxHashMap, FxHashSet};
use std::ops::{Index, IndexMut};
use std::ops::{Deref, DerefMut, Index, IndexMut};
use crate::node::{Node, NodeType, OwnedAttributeDiscription, OwnedAttributeValue};
use crate::node_ref::{AttributeMask, NodeMask};
@@ -26,7 +26,7 @@ fn mark_dirty(
/// To get started implement [crate::state::ParentDepState], [crate::state::NodeDepState], or [crate::state::ChildDepState] and call [RealDom::apply_mutations] to update the dom and [RealDom::update_state] to update the state of the nodes.
#[derive(Debug)]
pub struct RealDom<S: State> {
tree: Tree<Node<S>>,
pub tree: Tree<Node<S>>,
/// a map from element id to real node id
node_id_mapping: Vec<Option<RealNodeId>>,
nodes_listening: FxHashMap<String, FxHashSet<RealNodeId>>,
@@ -401,6 +401,20 @@ impl<S: State> RealDom<S> {
}
}
impl<S: State> Deref for RealDom<S> {
type Target = Tree<Node<S>>;
fn deref(&self) -> &Self::Target {
&self.tree
}
}
impl<S: State> DerefMut for RealDom<S> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.tree
}
}
impl<S: State> Index<ElementId> for RealDom<S> {
type Output = Node<S>;