userver: userver/storages/redis/expire_reply.hpp Source File
Loading...
Searching...
No Matches
expire_reply.hpp
1#pragma once
2
3#include <cstdint>
4#include <string>
5
6#include <userver/storages/redis/fwd.hpp>
7
8USERVER_NAMESPACE_BEGIN
9
10namespace storages::redis {
11
12class ExpireReply final {
13public:
14 enum class ExpireReplyValue { kKeyDoesNotExist, kTimeoutWasSet };
15
16 static constexpr ExpireReplyValue kKeyDoesNotExist = ExpireReplyValue::kKeyDoesNotExist;
17 static constexpr ExpireReplyValue kTimeoutWasSet = ExpireReplyValue::kTimeoutWasSet;
18
19 explicit ExpireReply(int64_t value);
20 ExpireReply(ExpireReplyValue value);
21
22 static ExpireReply Parse(ReplyData&& reply_data, const std::string& request_description = {});
23
24 operator ExpireReplyValue() const;
25
26private:
27 ExpireReplyValue value_;
28};
29
30} // namespace storages::redis
31
32#ifdef USERVER_FEATURE_LEGACY_REDIS_NAMESPACE
33namespace redis {
34using storages::redis::ExpireReply;
35}
36#endif
37
38USERVER_NAMESPACE_END