pub struct Renderer { /* private fields */ }Expand description
Manages the rendering of virtual DOM nodes to the real DOM.
Maintains a mapping between virtual nodes and real DOM elements, and handles creation, diffing, and patching of the DOM tree.
Implementations§
Source§impl Renderer
Implementation of the virtual DOM renderer.
impl Renderer
Implementation of the virtual DOM renderer.
Sourcepub fn render(&mut self, vnode: VirtualNode)
pub fn render(&mut self, vnode: VirtualNode)
Renders the given virtual DOM tree into the real DOM.
If a previous tree exists, patches the existing DOM to match the new tree. Otherwise, creates new DOM nodes from scratch and appends them to the root.
§Arguments
VirtualNode: The new virtual DOM tree to render.
Sourcepub fn render_full_replace(&mut self, vnode: VirtualNode)
pub fn render_full_replace(&mut self, vnode: VirtualNode)
Renders the given virtual DOM tree into the real DOM by fully replacing all existing content. Used when a match arm switch occurs (e.g. route change) where incremental patching would incorrectly align unrelated child nodes from the previous arm.
§Arguments
VirtualNode: The new virtual DOM tree to render.
Source§impl Renderer
impl Renderer
pub fn get_mut_root(&mut self) -> &mut Element
pub fn get_mut_current_tree(&mut self) -> &mut Option<VirtualNode>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Renderer
impl !RefUnwindSafe for Renderer
impl !Send for Renderer
impl !Sync for Renderer
impl Unpin for Renderer
impl UnsafeUnpin for Renderer
impl !UnwindSafe for Renderer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more