#include <userver/storages/redis/ttl_reply.hpp>
Parsed TTL / HTTL reply (seconds precision).
Also used for HTTL replies — in which case the value semantics mirror "field" instead of "key" (kKeyDoesNotExist=-2 means the field does not exist or the parent hash does not exist; kKeyHasNoExpiration=-1 means the field has no associated TTL).
For millisecond-precision commands (PTTL / HPTTL) use PttlReply.
Definition at line 25 of file ttl_reply.hpp.
Public Types | |
| enum class | TtlReplyValue { kKeyDoesNotExist = -2 , kKeyHasNoExpiration = -1 } |
Public Member Functions | |
| TtlReply (int64_t value) | |
| TtlReply (TtlReplyValue value) | |
| bool | KeyExists () const |
| bool | KeyHasExpiration () const |
| size_t | GetExpireSeconds () const |
| std::chrono::seconds | GetExpire () const |
Returns the expiration as std::chrono::seconds. Throws KeyHasNoExpirationException if the key/field has no expiration. | |
Static Public Member Functions | |
| static TtlReply | Parse (ReplyData &&reply_data, const std::string &request_description={}) |
Static Public Attributes | |
| static constexpr TtlReplyValue | kKeyDoesNotExist = TtlReplyValue::kKeyDoesNotExist |
| static constexpr TtlReplyValue | kKeyHasNoExpiration = TtlReplyValue::kKeyHasNoExpiration |
|
strong |
Definition at line 27 of file ttl_reply.hpp.
|
inline |
Definition at line 39 of file ttl_reply.hpp.
|
staticconstexpr |
Definition at line 29 of file ttl_reply.hpp.
|
staticconstexpr |
Definition at line 30 of file ttl_reply.hpp.