make dioxus dependancy optional

This commit is contained in:
Evan Almloff committed 2023-02-04 17:56:30 -06:00
1 parent 8dde4e492f
commit 6fe00c4f78
12 files changed
+1152 -1195

No files matched your search

+11 -27
View File
@@ -8,6 +8,8 @@ pub use real_dom::{NodeMut, NodeRef, RealDom};
use rustc_hash::FxHasher;
pub use tree::NodeId;
#[cfg(feature = "dioxus")]
pub mod dioxus;
pub mod layout_attributes;
pub mod node;
pub mod node_ref;
@@ -16,33 +18,15 @@ pub mod real_dom;
pub mod tree;
pub mod utils;
pub mod prelude {
pub use crate::node::{ElementNode, FromAnyValue, NodeType, OwnedAttributeView};
pub use crate::node_ref::{AttributeMaskBuilder, NodeMaskBuilder, NodeView};
pub use crate::passes::{Dependancy, Pass};
pub use crate::real_dom::{NodeImmutable, NodeMut, NodeMutRaw, NodeMutable, NodeRef, RealDom};
pub use crate::tree::NodeId;
pub use crate::SendAnyMap;
}
pub type FxDashMap<K, V> = dashmap::DashMap<K, V, BuildHasherDefault<FxHasher>>;
pub type FxDashSet<K> = dashmap::DashSet<K, BuildHasherDefault<FxHasher>>;
pub type SendAnyMap = anymap::Map<dyn Any + Send + Sync + 'static>;
/// Used in derived state macros
#[derive(Eq, PartialEq)]
#[doc(hidden)]
pub struct HeightOrdering {
pub height: u16,
pub id: NodeId,
}
impl HeightOrdering {
pub fn new(height: u16, id: NodeId) -> Self {
HeightOrdering { height, id }
}
}
// not the ordering after height is just for deduplication it can be any ordering as long as it is consistent
impl Ord for HeightOrdering {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.height.cmp(&other.height).then(self.id.cmp(&other.id))
}
}
impl PartialOrd for HeightOrdering {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}