Skip to main content

euv_core/renderer/
struct.rs

1use crate::*;
2
3/// Manages the rendering of virtual DOM nodes to the real DOM.
4///
5/// Maintains a mapping between virtual nodes and real DOM elements,
6/// and handles creation, diffing, and patching of the DOM tree.
7#[derive(Data, New)]
8pub struct Renderer {
9    /// Mapping from virtual node IDs to real DOM elements.
10    #[new(skip)]
11    node_map: HashMap<usize, Element>,
12    /// The root DOM element.
13    root: Element,
14    /// The current virtual DOM tree.
15    #[new(skip)]
16    current_tree: Option<VirtualNode>,
17    /// Counter for generating unique node IDs.
18    #[new(skip)]
19    next_id: Rc<RefCell<usize>>,
20}