pub enum Cond {
Always,
NotSet,
AlreadySet,
Greater,
Less,
LessAndSet,
}Expand description
The condition on a deadline being set, which is NX, XX, GT or LT.
A hash field command takes exactly one of the four keywords. EXPIRE on a
whole key takes a set of them and accepts two, XX GT and XX LT, which is
where Cond::LessAndSet comes from. XX GT is not a sixth case because
GT already refuses a key with no deadline, so it means the same thing as
GT alone.
Variants§
Always
No condition. Set it whatever was there.
NotSet
Only if the field has no deadline now.
AlreadySet
Only if the field has one now.
Greater
Only if it moves the deadline later, or there was none.
Less
Only if it moves the deadline earlier, or there was none.
LessAndSet
Only if there is one now and this moves it earlier.
XX LT on a key. It is a separate case because LT on its own accepts a
key with no deadline, on the reading that no deadline is infinitely far
away, and XX is what takes that reading away.