ValueOpcode

class dsviper.ValueOpcode

Bases: object

The base of the opcode hierarchy.

Recorded by CommitMutableState as it applies mutations through the AttachmentMutating interface, and read back through the concrete subclasses: type() and key(), plus each one’s own arguments.

Note: Not directly instantiable.

static decode(blob: ValueBlob, definitions: DefinitionsConst, *, stream_codec_instancing: StreamCodecInstancing | None = None) → list[ValueOpcode]

Return the opcodes blob holds, typed against definitions.

stream_codec_instancing chooses the codec; Codec.STREAM_BINARY is used when it is None.

static encode(opcodes: list[ValueOpcode], *, stream_codec_instancing: StreamCodecInstancing | None = None) → ValueBlob

Return a blob encoding opcodes.

stream_codec_instancing chooses the codec; Codec.STREAM_BINARY is used when it is None.

static read(stream_reading: StreamReading, definitions: DefinitionsConst) → list[ValueOpcode]

Read the opcodes from stream_reading, typed against definitions.

static write(opcodes: list[ValueOpcode], stream_writing: StreamWriting) → None

Write opcodes into stream_writing.