vibe.db.redis.idioms
Type safe implementations of common Redis storage idioms.
Note that the API is still subject to change!
Copyright
Types 8
void initialize(RedisDatabase db, Replicate!(string, ID_LENGTH) name, string suffix = null)T opIndex(IDS id)void remove(IDS id)Removes an ID along with the corresponding value.string getKey(IDS ids)this(RedisDatabase db, Replicate!(string, ID_LENGTH) name, string suffix = null)Models a single strongly typed object.
This structure is rougly equivalent to a value of type T. The underlying data is represented as a Redis hash. This means that only primitive fields are supported for T.
T get() @propertyvoid opAssign(T val)void opUnary(string op)() if(op == "++")void opUnary(string op)() if(op == "--")void opOpAssign(string op)(long val) if (op == "+")void opOpAssign(string op)(long val) if (op == "-")void opOpAssign(string op)(double val) if (op == "+")void opOpAssign(string op)(double val) if (op == "-")void performLocked(scope void delegate() del)this(RedisDatabase db, string lock_key)T valueRepresents the stripped type of a struct.
Strips all fields that cannot be directly stored as values in the Redis database. By default, any field named id or _id is also stripped. Set the strip_id parameter to false to keep those fields.
See_also: redisStrip
T unstrip(StrippedMembers stripped_members)Reconstructs the full (unstripped) struct value.void populateRedisFields(ref T dst, UnstrippedMembers values)void populateNonRedisFields(ref T dst, StrippedMembers values)string membersString()this(in T src)Functions 3
JsonEncoded!T jsonEncoded(T)(T value)RedisStripped!(T, strip_id) redisStrip(bool strip_id = true, T)(in T val)Strips all non-Redis fields from a struct.Templates 13
Models a set of numbered hashes.
This structure is roughly equivalent to a string[string][long] and is commonly used to store collections of objects, such as all users of a service. For a strongly typed variant of this class, see
RedisObjectCollection.
See_also: RedisObjectCollection
Models a strongly typed set of numbered hashes.
This structure is roughly equivalent of a T[long].
See_also: RedisHashCollection
Models a strongly typed numbered set of values.
Models a strongly typed numbered set of values.
Models a strongly typed numbered set of values.