pub struct Recording(/* private fields */);Expand description
The recording renderer: a handle; clones share one log.
Implementations§
Source§impl Recording
impl Recording
Sourcepub fn mark(&self) -> usize
pub fn mark(&self) -> usize
Where the log stands: Self::calls_since takes it.
Sourcepub fn calls_since(&self, mark: usize) -> Vec<Call>
pub fn calls_since(&self, mark: usize) -> Vec<Call>
The calls after mark.
Sourcepub fn html(&self, node: u32) -> String
pub fn html(&self, node: u32) -> String
What is drawn under node, as HTML: attributes in name order, a
text node’s text as it is (an anchor draws nothing).
Sourcepub fn under(&self, node: u32) -> Vec<u32>
pub fn under(&self, node: u32) -> Vec<u32>
The nodes now in the tree under node (itself included), depth first.
Sourcepub fn find_attr(&self, name: &str, value: &str) -> Vec<u32>
pub fn find_attr(&self, name: &str, value: &str) -> Vec<u32>
The elements now in the tree with attribute name = value.
Sourcepub fn fire(&self, node: u32, event: &str, payload: Value)
pub fn fire(&self, node: u32, event: &str, payload: Value)
Fires event on node with payload: each listener on it runs.
Sourcepub fn fire_window(&self, event: &str, payload: Value)
pub fn fire_window(&self, event: &str, payload: Value)
UI-10: fires event on the window: each window-<event>
registration held runs (whose node is drawn, as the DOM renderer’s
guard does).
Sourcepub fn window_listeners(&self) -> usize
pub fn window_listeners(&self) -> usize
The window-* registrations held now — raw: one not taken away is
counted whether or not its node is drawn.
Trait Implementations§
Source§impl Renderer for Recording
impl Renderer for Recording
type Node = u32
fn create_element(&self, tag: &str) -> u32
Source§fn create_text(&self, text: &str) -> u32
fn create_text(&self, text: &str) -> u32
A text node holding
text (an if’s or each’s anchor is an empty one).fn set_attr(&self, node: &u32, name: &str, value: &str)
Source§fn remove_attr(&self, node: &u32, name: &str)
fn remove_attr(&self, node: &u32, name: &str)
FRAME-50: the attribute
name taken off node.fn set_text(&self, node: &u32, text: &str)
Source§fn insert(&self, parent: &u32, child: &u32, before: Option<&u32>)
fn insert(&self, parent: &u32, child: &u32, before: Option<&u32>)
child into parent, before before (none: last).fn remove(&self, parent: &u32, child: &u32)
Source§fn marks(&self, root: &u32) -> Vec<u32>
fn marks(&self, root: &u32) -> Vec<u32>
FRAME-18: the elements under
root (itself left out) carrying
data-slot — a layout’s section marks — in document order.Source§fn attrs(&self, node: &u32) -> Vec<(String, String)>
fn attrs(&self, node: &u32) -> Vec<(String, String)>
FRAME-18: an element’s attributes,
(name, value) each.Source§fn contains(&self, ancestor: &u32, node: &u32) -> bool
fn contains(&self, ancestor: &u32, node: &u32) -> bool
FRAME-18: whether
node is ancestor or under it.Source§fn observe(&self, _root: &u32, _f: Rc<dyn Fn(Vec<u32>)>) -> Unlisten
fn observe(&self, _root: &u32, _f: Rc<dyn Fn(Vec<u32>)>) -> Unlisten
FRAME-18: calls
f after each batch of changes under root that
touch a mark — a node added or removed that is or holds a
[data-slot], an attribute set on a mark, at any depth — with the
node each such change was made in; the answer stops it. The recording
renderer observes nothing (the host also walks after mount and
update); the DOM’s is a MutationObserver.Source§fn sheet(&self, key: &str, _css: &str, on: bool)
fn sheet(&self, key: &str, _css: &str, on: bool)
FRAME-30: the sheet
key (its text css) adopted by the page
(on), synchronously, or dropped — document.adoptedStyleSheets, no
<link>. The engine calls it once per key each way (it counts the
instances).Source§fn listen(
&self,
node: &u32,
event: &str,
handler: Rc<dyn Fn(Value)>,
) -> Unlisten
fn listen( &self, node: &u32, event: &str, handler: Rc<dyn Fn(Value)>, ) -> Unlisten
Calls
handler with the event’s payload whenever event fires on
node (window-<event>: on the window, while node is mounted).
UI-10: the answer takes the listener away again — the tree calls it
when the node’s block goes, so no closure outlives its component.Source§fn listen_keys(&self, f: Rc<dyn Fn(&Press) -> bool>) -> Unlisten
fn listen_keys(&self, f: Rc<dyn Fn(&Press) -> bool>) -> Unlisten
FRAME-36: calls
f with every key press the window hears, in the
capture phase, before anything of the page; when f answers true
the press is the host’s — preventDefault(), stopPropagation(),
stopImmediatePropagation(). The answer stops it. The recording
renderer hears nothing (the tests press through App::press).Source§fn keys_overlay(&self, groups: Option<&KeyGroups>)
fn keys_overlay(&self, groups: Option<&KeyGroups>)
FRAME-36: the host’s keys overlay,
[data-engine-keys], drawn with
groups (every mounted component’s keys), or taken away (none).Auto Trait Implementations§
impl !RefUnwindSafe for Recording
impl !Send for Recording
impl !Sync for Recording
impl !UnwindSafe for Recording
impl Forget for Recording
impl Freeze for Recording
impl Unpin for Recording
impl UnsafeUnpin for Recording
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Variant for T
impl<T> Variant for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert this
Variant trait object to &mut dyn Any.Source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Convert this
Variant trait object to Box<dyn Any>.