Expand description
Key and value byte aliases plus database codec adapters.
The aliases distinguish keys from values while sharing compact storage; raw aliases default to borrowed byte slices, while buffer aliases provide inline capacity for common payload sizes. Serialization helpers encode typed components with the database record codec, and projection helpers consume pairs to return one component without cloning or reserializing it.
Constantsยง
- DEF_
STACK_ CAP - Default inline byte capacity for a generic
Buffer. - KEY_
STACK_ CAP - Default inline byte capacity for serialized keys.
- VAL_
STACK_ CAP - Default inline byte capacity for serialized values.
Functionsยง
- _expect_
deserialize ๐ - Deserializes both components and treats any input or codec error as fatal.
- _expect_
deserialize_ ๐key - Deserializes a key and treats any input or codec error as fatal.
- deserialize ๐
- deserialize_
key ๐ - deserialize_
val ๐ - key
- Returns the key component of a database pair.
- result_
deserialize ๐ - result_
deserialize_ ๐key - serialize_
key - Serializes a database key into an inline-backed key buffer.
- serialize_
val - Serializes a database value into an inline-backed value buffer.
- val
- Returns the value component of a database pair.
Type Aliasesยง
- Buffer
- Inline-backed byte buffer used by serialized keys and values.
- Byte
- Byte element used by raw database slices and buffers.
- Key
- Database key, borrowing a raw byte slice by default.
- KeyBuf
- Default inline-backed buffer for a serialized key.
- KeyBuffer
- Inline-backed key buffer with a configurable byte capacity.
- KeyVal
- Database key and value pair, borrowing raw byte slices by default.
- Slice
- Unsized byte slice used by raw database APIs.
- Val
- Database value, borrowing a raw byte slice by default.
- ValBuf
- Default inline-backed buffer for a serialized value.
- ValBuffer
- Inline-backed value buffer with a configurable byte capacity.