ControlMessageCodec class
Encodes handshake ControlMessages to and from the JSON envelope
{"type": <type>, ...fields}, carried as WebSocket text frames.
Centralizes the type → fromJson dispatch so adding a handshake message
means registering it in one place. Only the handshake rides this codec —
everything after it is omnyhub's node protocol on its own 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
-
decode(
Map< String, dynamic> json) → ControlMessage - Decodes a JSON object into a ControlMessage.
-
encode(
ControlMessage message) → Map< String, dynamic> -
Encodes
messageto a JSON object, injectingtype. -
fromWire(
Message message) → ControlMessage -
Decodes an omnyhub
Messagefrom the wire. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
toWire(
ControlMessage message) → Message -
Encodes
messageas an omnyhub textMessagefor the wire.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- instance → const ControlMessageCodec
- The shared codec instance.