summaryrefslogtreecommitdiffstatshomepage
path: root/entity/snapshot.go
diff options
context:
space:
mode:
Diffstat (limited to 'entity/snapshot.go')
-rw-r--r--entity/snapshot.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/entity/snapshot.go b/entity/snapshot.go
index c6ea43fc..9dd109cf 100644
--- a/entity/snapshot.go
+++ b/entity/snapshot.go
@@ -1,14 +1,17 @@
package entity
// Snapshot is the minimal interface that a snapshot need to implement
-type Snapshot interface {
+type Snapshot SnapshotT[Operation]
+
+// SnapshotT is the minimal interface that a snapshot need to implement
+type SnapshotT[OpT Operation] interface {
// AllOperations returns all the operations that have been applied to that snapshot, in order
- AllOperations() []Operation
+ AllOperations() []OpT
// AppendOperation add an operation in the list
- AppendOperation(op Operation)
+ AppendOperation(op OpT)
}
-type CompileToSnapshot[SnapT Snapshot] interface {
+type CompileToSnapshot[OpT Operation, SnapT Snapshot] interface {
// Compile an Entity in an easily usable snapshot
Compile() SnapT
}