OperationEnvelopeCodec class

Binary envelope for operations.

Format:

  • handlerTypeLen: uvarint
  • handlerType: utf8
  • handlerIdLen: uvarint
  • handlerId: utf8
  • kind: u8, where bit 7 declares the kind stamped
  • body: bytes

Bit 7 of the kind byte is what caps a kind at OperationType.maxKind. It costs no bytes of its own: a stamped operation is marked here, and the mark itself is the id of the change it travels in.

Constructors

OperationEnvelopeCodec()

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

decode(Uint8List bytes) → OperationEnvelope
Decodes an OperationEnvelope from a byte array.
encode({required String handlerType, required String handlerId, required int kind, required Uint8List body, bool stamped = false}) → Uint8List
Encodes an OperationEnvelope into a byte array.
writeEnvelopePrefix(BytesBuilder out, String handlerType, String handlerId) → void
Writes the part of the envelope that identifies the handler: [uvarint typeLen][type utf8][uvarint idLen][id utf8].