Crate kvstructs

Source
Expand description

General basic key-value structs for Key-Value based storages.

Modules§

bytes
re-export bytes crate.
iterator
Iterator trait
raw_pointer
Unsafe raw pointer for Key, Value, Entry

Structs§

EncodedValue
EncodedValue contains the data need to be stored in Bytes.
Entry
Entry provides Key, Value, UserMeta and ExpiresAt. This struct can be used by the user to set data.
Header
Header is used in value log as a header before Entry.
Key
A general Key for key-value storage, the underlying is u8 slice.
KeyMut
A general mutable Key for key-value storage, the underlying is u8 slice.
KeyRef
KeyRef can only contains a underlying u8 slice of Key
OP
Values have their first byte being byteData or byteDelete. This helps us distinguish between a key that has never been seen and a key that has been explicitly deleted.
Overflow
Uvariant overflows a 64-bit integer
Value
Value represents the value info that can be associated with a key, but also the internal Meta field. The data in the Value is not mutable.
ValueMut
ValueMut represents the value info that can be associated with a key, but also the internal Meta field. The data in the ValueMut is mutable.
ValueRef
ValueRef contains a &'a Value

Constants§

EXPIRATION_OFFSET
The position store expires_at in a encoded value
MAX_HEADER_SIZE
Maximum possible size of the header. The maximum size of header struct will be 18 but the maximum size of variant encoded header will be 21.
META_OFFSET
The position store meta in a encoded value
USER_META_OFFSET
The position store user meta in a encoded value

Traits§

KeyExt
Extensions for Key
KeyMutExt
Extensions for KeyMut
ValueExt
Extensions for Value
ValueMutExt
Extensions for ValueMut

Functions§

compare_key
Checks the key without timestamp and checks the timestamp if keyNoTs is same. a would be sorted higher than aa if we use bytes.compare All keys should have timestamp.
same_key
Checks for key equality ignoring the version timestamp.