userver: userver/storages/redis/expire_reply.hpp Source File
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
expire_reply.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file
4/// @brief Reply for the EXPIRE command
5
6#include <cstdint>
7#include <string>
8
9#include <userver/storages/redis/fwd.hpp>
10
11USERVER_NAMESPACE_BEGIN
12
13namespace storages::redis {
14
15class ExpireReply final {
16public:
17 enum class ExpireReplyValue { kKeyDoesNotExist, kTimeoutWasSet };
18
19 static constexpr ExpireReplyValue kKeyDoesNotExist = ExpireReplyValue::kKeyDoesNotExist;
20 static constexpr ExpireReplyValue kTimeoutWasSet = ExpireReplyValue::kTimeoutWasSet;
21
22 explicit ExpireReply(int64_t value);
23 ExpireReply(ExpireReplyValue value);
24
25 static ExpireReply Parse(ReplyData&& reply_data, const std::string& request_description = {});
26
27 operator ExpireReplyValue() const;
28
29private:
30 ExpireReplyValue value_;
31};
32
33} // namespace storages::redis
34
35USERVER_NAMESPACE_END