pub enum Kind {
String = 0,
Hash = 1,
Set = 2,
Zset = 3,
List = 4,
Stream = 5,
Array = 6,
Foreign = 7,
}Expand description
What TYPE calls a key, and what the meta byte’s tag holds.
The numbers are the same numbers yo_format::ValueType uses on disk, so that
saving a key is a copy of the tag rather than a translation of it. There is a
test at the bottom of this file holding the two in step, and it takes a dev
dependency on yo-format for no other reason.
The list is shorter than the on disk one because some of those are the same
thing in memory. A bitmap is a string and a HyperLogLog is a string, in Redis
as much as here, and TYPE on either answers string. The catalog draws
finer lines because a reader wants to know what a blob meant.
Variants§
String = 0
A string, and everything Redis stores as one.
Hash = 1
A hash.
Set = 2
A set.
Zset = 3
A sorted set.
List = 4
A list.
Stream = 5
A stream.
Array = 6
A sparse array.
Foreign = 7
A body this crate does not know the type of.
The last of the eight patterns the tag can hold, and it is spent on an escape rather than on one more type. Everything below this crate is a primitive that the document, vector and graph engines are built out of, so those engines sit above it and cannot be named here without a cycle, and there are three of them and one pattern. An escape holds all three, and the body says what it is when asked.
It is the one kind with no yo_format::catalog::ValueType beside it,
because this version’s writer does not save a foreign body and there is
nothing on disk for the catalog to name. When one of them becomes
saveable it gets its own number there, which does not have to be this
one, since nothing in a file has to agree with a tag that only ever
exists in memory.