This commit is contained in:
2026-01-24 00:28:43 +01:00
parent 15ff801cb0
commit 0a026c4ee7
3 changed files with 16 additions and 42 deletions
+3 -18
View File
@@ -6,24 +6,9 @@ pub mod state;
pub mod prelude {
pub use crate::component::*;
pub use crate::state::*;
pub use crate::Node;
pub use crate::{DrawContext, View};
}
#[derive(Clone)]
pub enum Node {
String(Arc<dyn Fn() -> String + Send + Sync>),
Component(component::Component),
}
pub type View = Arc<dyn Fn(&mut DrawContext) + Send + Sync>;
impl std::fmt::Debug for Node {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}",
match self {
Self::Component(_) => format!("Component"),
Self::String(v) => format!("String({})", v()),
}
)
}
}
pub struct DrawContext {}