6#include <userver/storages/redis/exception.hpp>
7#include <userver/storages/redis/impl/base.hpp>
8#include <userver/storages/redis/impl/command_options.hpp>
10#include <userver/storages/redis/scan_tag.hpp>
12USERVER_NAMESPACE_BEGIN
21using RangeOptions = USERVER_NAMESPACE::redis::
RangeOptions;
22using GeoaddArg = USERVER_NAMESPACE::redis::
GeoaddArg;
25using ZaddOptions = USERVER_NAMESPACE::redis::
ZaddOptions;
29 ScanOptionsBase() =
default;
35 template <
typename... Args>
36 ScanOptionsBase(Args&&... args) {
37 (Apply(std::forward<Args>(args)), ...);
42 explicit Match(std::string value) : value_(std::move(value)) {}
44 const std::string& Get()
const& {
return value_; }
46 std::string Get() && {
return std::move(value_); }
54 explicit Count(size_t value) : value_(value) {}
56 size_t Get()
const {
return value_; }
62 std::optional<
Match> ExtractMatch() {
return std::move(pattern_); }
64 std::optional<
Count> ExtractCount() {
return std::move(count_); }
67 void Apply(
Match pattern) {
70 "duplicate Match parameter");
71 pattern_ = std::move(pattern);
74 void Apply(
Count count) {
77 "duplicate Count parameter");
81 std::optional<
Match> pattern_;
82 std::optional<
Count> count_;
86template <ScanTag scan_tag>
96void PutArg(USERVER_NAMESPACE::redis::CmdArgs::CmdArgsArray& args_,
98void PutArg(USERVER_NAMESPACE::redis::CmdArgs::CmdArgsArray& args_,