(key string, value T)
| 71 | } |
| 72 | |
| 73 | func (this *Table[T]) Set(key string, value T) error { |
| 74 | if this.isClosed { |
| 75 | return NewTableClosedErr(this.name) |
| 76 | } |
| 77 | |
| 78 | if len(key) > KeyMaxLength { |
| 79 | return ErrKeyTooLong |
| 80 | } |
| 81 | |
| 82 | valueBytes, err := this.encoder.Encode(value) |
| 83 | if err != nil { |
| 84 | return err |
| 85 | } |
| 86 | |
| 87 | return this.WriteTx(func(tx *Tx[T]) error { |
| 88 | return this.set(tx, key, valueBytes, value, false, false) |
| 89 | }) |
| 90 | } |
| 91 | |
| 92 | func (this *Table[T]) SetSync(key string, value T) error { |
| 93 | if this.isClosed { |
no test coverage detected