SemanticsWireEncoder class final
Server side: turns semantic frames into compact wire payloads, emitting a full frame once per connection and patches thereafter. One instance per served session (it holds the last-sent state). Two entry points share that state: encodeTree (the serve render loop's path — redacts only the changed nodes on demand, O(changed)) and encode (for consumers that already hold a pre-redacted SemanticInspectionSnapshot, e.g. inspection/agent bridges).
Constructors
- SemanticsWireEncoder({int maxWirePayloadLength = maxRemoteDocumentFramePayloadLength})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastFlattenedNodeCount → int
-
How many nodes the most recent encodeTree redacted and flattened. On a
steady-state encodeTree patch this is O(changed) — the very count a
regression back to full-tree redaction blows up to O(tree); the first
(full) frame flattens the whole tree. Drives the serve-semantics
redaction-cost gate; it does not describe a snapshot's lazy index cost.
no setter
- lastRejection → String?
-
Why the last encode sent nothing although the tree changed — the tree
could not be sent — or null when it sent a frame or nothing changed. A
host reports it: the peer's accessibility tree and agents see nothing
until the tree can be sent again.
no setter
- maxWirePayloadLength → int
-
Maximum bytes for both an emitted frame and the equivalent retained FULL.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
encode(
SemanticInspectionSnapshot snapshot, {SemanticWireDelta? delta}) → Uint8List? -
Encodes a pre-redacted
snapshotfor the wire — the snapshot-based path for inspection/agent consumers that already hold a SemanticInspectionSnapshot (the serve render loop instead uses encodeTree, which redacts on demand). Returns null when the exposed semantics are unchanged since the last send. -
encodeTree(
SemanticTree tree, {SemanticTreeUpdate? update}) → Uint8List? -
Encodes
treefor the wire, or returns null when the exposed semantics are unchanged since the last send (so a dirty frame that didn't actually alter the accessible tree costs zero bytes). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void - Forgets the peer's state so the next encode re-sends a full frame.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited