pub enum Applied {
Missing = -2,
NotMet = 0,
Ok = 1,
Deleted = 2,
}Expand description
What setting a deadline did.
Not called Set, because crate::Set is a set and two types with that
name in one crate is a trap for whoever reads it next.
The numbers are Redis’s, from the SetExRes enum in t_hash.c, and they are
what HEXPIRE puts in its reply array. They are here rather than in the
protocol layer because they are semantics: whether a past deadline deletes the
field or stores it is a decision about the data structure, and the reply just
reports it.
EXPIRE on a whole key produces the same four outcomes and reports them with
two numbers instead of four, so Keyspace::expire answers this and the wire
folds it. EXPIRE cannot tell you whether the key went away or the deadline
went on, and this can.
Variants§
Missing = -2
No such field, or no such key. Redis replies -2 for a field, and does the same for a hash that is not there at all, because a missing key and an empty hash are the same thing.
NotMet = 0
The condition was not met, so nothing changed. Redis replies 0.
Ok = 1
Set or updated. Redis replies 1.
Deleted = 2
The deadline was already in the past, so the field is gone rather than expiring later. Redis replies 2, and the caller has to actually remove the field, because this structure holds deadlines and not fields.