Skip to main content

Recording

Struct Recording 

Source
pub struct Recording(/* private fields */);
Expand description

The recording renderer: a handle; clones share one log.

Implementations§

Source§

impl Recording

Source

pub fn new() -> Self

A log holding only the root, 0 (<root>).

Source

pub fn root(&self) -> u32

The root node.

Source

pub fn calls(&self) -> Vec<Call>

Every call so far.

Source

pub fn mark(&self) -> usize

Where the log stands: Self::calls_since takes it.

Source

pub fn calls_since(&self, mark: usize) -> Vec<Call>

The calls after mark.

Source

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).

Source

pub fn under(&self, node: u32) -> Vec<u32>

The nodes now in the tree under node (itself included), depth first.

Source

pub fn find_attr(&self, name: &str, value: &str) -> Vec<u32>

The elements now in the tree with attribute name = value.

Source

pub fn find_tag(&self, tag: &str) -> Vec<u32>

The elements now in the tree named tag.

Source

pub fn fire(&self, node: u32, event: &str, payload: Value)

Fires event on node with payload: each listener on it runs.

Source

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).

Source

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.

Source

pub fn listeners(&self) -> usize

Every registration held now, raw (element and window).

Trait Implementations§

Source§

impl Clone for Recording

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Recording

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Recording

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Renderer for Recording

Source§

type Node = u32

Source§

fn create_element(&self, tag: &str) -> u32

Source§

fn create_text(&self, text: &str) -> u32

A text node holding text (an if’s or each’s anchor is an empty one).
Source§

fn set_attr(&self, node: &u32, name: &str, value: &str)

Source§

fn remove_attr(&self, node: &u32, name: &str)

FRAME-50: the attribute name taken off node.
Source§

fn set_text(&self, node: &u32, text: &str)

Source§

fn insert(&self, parent: &u32, child: &u32, before: Option<&u32>)

child into parent, before before (none: last).
Source§

fn remove(&self, parent: &u32, child: &u32)

Source§

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)>

FRAME-18: an element’s attributes, (name, value) each.
Source§

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

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)

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

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

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>)

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Variant for T
where T: Any + Clone + SendSync,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert this Variant trait object to &dyn Any.
Source§

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>

Convert this Variant trait object to Box<dyn Any>.
Source§

fn type_name(&self) -> &'static str

Get the name of this type.
Source§

fn clone_object(&self) -> Box<dyn Variant>

Clone this Variant trait object.