CommitProgram¶
- class dsviper.CommitProgram¶
Bases:
objectThe sequence of opcodes a commit carries.
Accumulated by CommitMutableState as mutations are applied, and decoded back when the commit is read. all_opcodes() returns the whole sequence; opcodes() and document_set_keys() index it by key and by attachment.
Note: Not directly instantiable.
- all_opcodes() list[CommitOpcode]¶
Return the list of all opcodes.
- document_set_keys(attachment_runtime_id: ValueUUId) set[CommitOpcodeKey]¶
Return the set of CommitOpcodeKey that a Document_Set opcode targets in the attachment attachment_runtime_id names.
- has_document_set(opcode_key: CommitOpcodeKey) bool¶
Return True if an opcode ‘Document_Set’ is associated with the opcode_key.
- opcodes(attachment_runtime_id: ValueUUId, key: ValueKey) list[CommitOpcode]¶
Return the list of opcodes applying to key under attachment_runtime_id.
key is the instance’s ValueKey, not a CommitOpcodeKey: the two arguments together make the CommitOpcodeKey the program is indexed by.