Skip to main content

DomOp

Enum DomOp 

Source
pub enum DomOp {
Show 29 variants CreateElement { node: u32, tag: String, }, CreateTextNode { node: u32, text: String, }, SetText { node: u32, text: String, }, SetHtml { node: u32, html: String, }, ClearChildren { node: u32, }, SetAttribute { node: u32, name: String, value: String, }, AppendChild { parent: u32, child: u32, }, SetValue { node: u32, value: String, }, SetStream { node: u32, stream: i64, }, RtcPeerConnection { pc: u32, }, RtcDataChannel { pc: u32, channel: u32, label: String, }, RtcCreateOffer { pc: u32, }, RtcCreateAnswer { pc: u32, }, RtcSetLocal { pc: u32, sdp: String, }, RtcSetRemote { pc: u32, sdp: String, }, RtcAddIce { pc: u32, candidate: String, }, RtcSend { channel: u32, bytes: u64, }, AddEventListener { node: u32, event: String, }, SetChecked { node: u32, checked: bool, }, PreventDefault { node: u32, event: String, }, RemoveNode { node: u32, }, InsertBefore { parent: u32, child: u32, before: u32, }, RemoveAttribute { node: u32, name: String, }, Adopt { parent: u32, node: u32, tag: String, }, AdoptText { parent: u32, node: u32, text: String, }, Listen { node: u32, event: String, flags: u8, }, Unlisten { node: u32, event: String, }, FreeNode { node: u32, }, Hydrate { root: u32, },
}
Expand description

One recorded DOM mutation. Nodes are referenced by their creation ordinal (the handle, assigned sequentially from 0 = body), so op-logs compare equal across tiers regardless of how each tier numbers its handles internally.

Variants§

§

CreateElement

Fields

§node: u32
§

CreateTextNode

Fields

§node: u32
§text: String
§

SetText

Fields

§node: u32
§text: String
§

SetHtml

Fields

§node: u32
§html: String
§

ClearChildren

Fields

§node: u32
§

SetAttribute

Fields

§node: u32
§name: String
§value: String
§

AppendChild

Fields

§parent: u32
§child: u32
§

SetValue

Fields

§node: u32
§value: String
§

SetStream

Attach an opaque host media stream (a MediaStream handle) to an element’s srcObject — the primitive that renders a peer’s live video/audio in a <video>/<audio> tile.

Fields

§node: u32
§stream: i64
§

RtcPeerConnection

Fields

§pc: u32
§

RtcDataChannel

Fields

§pc: u32
§channel: u32
§label: String
§

RtcCreateOffer

Fields

§pc: u32
§

RtcCreateAnswer

Fields

§pc: u32
§

RtcSetLocal

Fields

§pc: u32
§

RtcSetRemote

Fields

§pc: u32
§

RtcAddIce

Fields

§pc: u32
§candidate: String
§

RtcSend

Fields

§channel: u32
§bytes: u64
§

AddEventListener

Fields

§node: u32
§event: String
§

SetChecked

setChecked(el, on) — a checkbox’s or radio’s CHECKED state.

Deliberately not a SetAttribute. In HTML checked is a PRESENCE, and in the DOM it is two different things: the ATTRIBUTE is defaultChecked (what the box returns to on a form reset) while the live state a visitor sees and a form submits is the PROPERTY. Writing the attribute therefore leaves a box the page believes is checked drawn unchecked. Carrying it as a boolean op means both tiers agree on presence and absence rather than on a string, and checked="false" — which every browser reads as CHECKED — is unspellable.

Fields

§node: u32
§checked: bool
§

PreventDefault

★ THIS LISTENER CANCELS THE BROWSER’S OWN ACTION for event on node.

on-submit.prevent={save} means the page handles the submit and the browser must not ALSO post the form — otherwise the request goes twice, once to the handler and once to the server, which is the duplicate-submission bug every form library exists to avoid. It is a property of the REGISTRATION, not of the event, so it is recorded where the listener is attached rather than discovered when one fires.

Fields

§node: u32
§event: String
§

RemoveNode

Detach a node from wherever it currently lives — the single-node counterpart to ClearChildren, so a keyed diff drops exactly the rows it stopped rendering instead of tearing down and rebuilding the whole parent.

Fields

§node: u32
§

InsertBefore

Move child under parent, immediately before before — or last, when before is u32::MAX (the same “no such element” sentinel documented in patch.rs; handle 0 is body here, so it cannot double as the “append” marker). The op a keyed reorder’s minimal move set is built from: child keeps its identity, so a reused row keeps whatever focus, selection or typed value it already carries.

Fields

§parent: u32
§child: u32
§before: u32
§

RemoveAttribute

Remove an attribute a new render dropped — the deletion SetAttribute cannot express.

Fields

§node: u32
§name: String
§

Adopt

Bind node to the next element under parent that the markup a DomOp::Hydrate opened already holds, when its tag is tag; an element of another tag, or none, is a mismatch the stream’s apply counts, and node stays unbound.

Fields

§parent: u32
§node: u32
§

AdoptText

Bind node to its place in the run of text the markup holds under parent before the next adopted element, holding text. The run is split along its claims when they spell it and rebuilt when they do not: a text node carries nothing a visitor did to it.

Fields

§parent: u32
§node: u32
§text: String
§

Listen

Register event on node with a bitmask of behavioural modifiers (.prevent / .stop / .once / .capture / .passive) — the generalisation AddEventListener / PreventDefault predate, carrying every modifier in one registration rather than one op per behaviour.

Fields

§node: u32
§event: String
§flags: u8
§

Unlisten

Remove a listener a new render dropped.

Fields

§node: u32
§event: String
§

FreeNode

Detach node from its parent AND release the id of node and EVERY descendant — the document-side half of heap reclamation, and ONE op per removed subtree root regardless of its size: a 1,000-row list clear is 1,000 FreeNodes, not a FreeNode per node. The host walks the (about to be detached) subtree once, deleting each id from its own node table, rather than the emitter naming every descendant — a descendant has no RemoveNode/ FreeNode of its own; removing/freeing its ancestor is what removes/frees it.

Fields

§node: u32
§

Hydrate

Open a hydration of root: the markup it holds is the page’s first paint, drawn before the program ran, and the stream’s Adopt/AdoptText claim its nodes instead of creating them. When the stream ends, whatever the markup holds that no claim bound is removed.

Fields

§root: u32

Trait Implementations§

Source§

impl Clone for DomOp

Source§

fn clone(&self) -> DomOp

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for DomOp

Source§

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

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

impl PartialEq for DomOp

Source§

fn eq(&self, other: &DomOp) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for DomOp

Source§

impl StructuralPartialEq for DomOp

Auto Trait Implementations§

§

impl Freeze for DomOp

§

impl RefUnwindSafe for DomOp

§

impl Send for DomOp

§

impl Sync for DomOp

§

impl Unpin for DomOp

§

impl UnsafeUnpin for DomOp

§

impl UnwindSafe for DomOp

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

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

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

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

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

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

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

§

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

§

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