pub enum Value {
V8(Vec<u8>),
Bytes(Vec<u8>),
U64(u64),
}
Expand description
A serialized value for a KV pair as stored in the database. All values can be serialized into the V8 representation, but not all values are.
The V8 representation is an opaque byte array that is only meaningful to the V8 engine. It is guaranteed to be backwards compatible. Because this representation is opaque, it is not possible to inspect or modify the value without deserializing it.
The inability to inspect or modify the value without deserializing it means that these values can not be quickly modified when performing atomic read-modify-write operations on the database (because the database may not have the ability to deserialize the V8 value into a modifiable value).
Because of this constraint, there are more specialized representations for certain types of values that can be used in atomic read-modify-write operations. These specialized representations are:
- Bytes: an arbitrary byte array.
- U64: a 64-bit unsigned integer.