Skip to content

struct

MemoryHost

pub struct MemoryHost {
    /* private fields */
}

An in-memory host that mirrors the tree by applying patches. Clones share state, so a test can keep one clone and give another to [App::mount].

Methods

new

pub fn new() -> MemoryHost

An empty host: nothing rendered, no patches, no errors.

tree

pub fn tree(&self) -> Vec<VNode>

A copy of the tree the host holds, with every patch applied.

patches

pub fn patches(&self) -> Vec<Patch>

Every patch applied so far.

clear_patches

pub fn clear_patches(&self)

Forget the patches recorded so far (to see only the next render's).

errors

pub fn errors(&self) -> Vec<String>

The render errors reported after the first render, oldest first.

dispatch

pub fn dispatch(&self, path: &[usize], event: &Event) -> bool

Simulate a user event at path.

Trait implementations