PulseContextCodec class
Serialises and deserialises PulseContext, preserving the full parent chain.
How it works
PulseContext is inherited: childContext.reason walks up to
parentContext.reason if the child didn't override it. The wire format
must therefore preserve the chain, not just the resolved values.
toJson walks to the root and stores an array of deltas (root
first, leaf last). fromJson reconstructs the chain as a fold of
fromEntries(parent: previous).
Every level of the chain is emitted — including levels whose local
record is empty (e.g. PulseContext.system) — so that
encode(decode(encode(x))) == encode(x) holds byte-for-byte.
See also:
- PulseCodec — the pulse serialiser that delegates to this codec.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJson(
Map< String, Object?> json) → PulseContext - Reconstructs a PulseContext from toJson's output.
-
toJson(
PulseContext context) → Map< String, Object?> -
Encodes
context(and its full lineage) to a canonical JSON map.