userver: storages::redis::PttlReply Class Reference
Loading...
Searching...
No Matches
storages::redis::PttlReply Class Referencefinal

#include <userver/storages/redis/pttl_reply.hpp>

Detailed Description

Parsed PTTL / HPTTL reply (millisecond precision).

Sibling of TtlReply for the millisecond-precision variants of the TTL commands. Reuses KeyHasNoExpirationException for its error case.

Definition at line 21 of file pttl_reply.hpp.

Public Types

enum class  PttlReplyValue : std::int8_t {
  kKeyDoesNotExist = -2 ,
  kKeyHasNoExpiration = -1
}
 

Public Member Functions

 PttlReply (int64_t value)
 
 PttlReply (PttlReplyValue value)
 
bool KeyExists () const
 
bool KeyHasExpiration () const
 
std::chrono::milliseconds GetExpire () const
 Returns the expiration as std::chrono::milliseconds. Throws KeyHasNoExpirationException if the key/field has no expiration.
 

Static Public Member Functions

static PttlReply Parse (ReplyData &&reply_data, const std::string &request_description={})
 Parse a reply from a milliseconds-precision command (PTTL / HPTTL).
 

Static Public Attributes

static constexpr PttlReplyValue kKeyDoesNotExist = PttlReplyValue::kKeyDoesNotExist
 
static constexpr PttlReplyValue kKeyHasNoExpiration = PttlReplyValue::kKeyHasNoExpiration
 

Member Enumeration Documentation

◆ PttlReplyValue

enum class storages::redis::PttlReply::PttlReplyValue : std::int8_t
strong

Definition at line 23 of file pttl_reply.hpp.

Member Data Documentation

◆ kKeyDoesNotExist

PttlReplyValue storages::redis::PttlReply::kKeyDoesNotExist = PttlReplyValue::kKeyDoesNotExist
staticconstexpr

Definition at line 28 of file pttl_reply.hpp.

◆ kKeyHasNoExpiration

PttlReplyValue storages::redis::PttlReply::kKeyHasNoExpiration = PttlReplyValue::kKeyHasNoExpiration
staticconstexpr

Definition at line 29 of file pttl_reply.hpp.


The documentation for this class was generated from the following file: