userver: storages::redis::HsetexOptions Struct Reference
Loading...
Searching...
No Matches
storages::redis::HsetexOptions Struct Reference

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

Detailed Description

Options for HSETEX (FNX/FXX combined with EX/PX/EXAT/PXAT/KEEPTTL).

Definition at line 301 of file command_options.hpp.

Public Types

enum class  Exist : std::uint8_t {
  kSetAlways ,
  kSetIfNoneExist ,
  kSetIfAllExist
}
 Existence precondition for the affected fields. More...
 
enum class  TtlAction : std::uint8_t {
  kNone ,
  kSetSeconds ,
  kSetMilliseconds ,
  kSetAtSeconds ,
  kSetAtMilliseconds ,
  kKeepTtl
}
 What TTL clause to attach to the new values. More...
 

Public Member Functions

HsetexOptionsOnlyIfNoneOfFieldsExist () &
 Chainable modifier — FNX: write only if none of the affected fields currently exist.
 
HsetexOptionsOnlyIfAllFieldsExist () &
 Chainable modifier — FXX: write only if all of the affected fields currently exist.
 
HsetexOptions OnlyIfNoneOfFieldsExist () &&
 FNX (rvalue overload).
 
HsetexOptions OnlyIfAllFieldsExist () &&
 FXX (rvalue overload).
 

Static Public Member Functions

static HsetexOptions NoTtl ()
 No TTL clause on the wire — server applies default behavior.
 
static HsetexOptions KeepTtl ()
 KEEPTTL — keep the existing TTL of each field if any.
 
static HsetexOptions Expire (std::chrono::milliseconds ttl)
 Set TTL to a relative duration. Posted on the wire as PX (ms-precision).
 
static HsetexOptions ExpireAt (std::chrono::system_clock::time_point deadline)
 Set TTL to an absolute deadline. Posted on the wire as PXAT (ms-precision).
 

Public Attributes

Exist exist {Exist::kSetAlways}
 
TtlAction ttl_action {TtlAction::kNone}
 
std::chrono::milliseconds ttl {0}
 

Member Enumeration Documentation

◆ Exist

enum class storages::redis::HsetexOptions::Exist : std::uint8_t
strong

Existence precondition for the affected fields.

Enumerator
kSetAlways 

No precondition (default).

kSetIfNoneExist 

FNX — set only if none of the affected fields currently exists.

kSetIfAllExist 

FXX — set only if all of the affected fields currently exist.

Definition at line 303 of file command_options.hpp.

◆ TtlAction

enum class storages::redis::HsetexOptions::TtlAction : std::uint8_t
strong

What TTL clause to attach to the new values.

Enumerator
kNone 

No TTL clause on the wire — server applies default behavior.

kSetSeconds 

EX seconds.

kSetMilliseconds 

PX milliseconds.

kSetAtSeconds 

EXAT unix-ts-sec.

kSetAtMilliseconds 

PXAT unix-ts-ms.

kKeepTtl 

KEEPTTL — keep the existing TTL of each field if any; ttl is ignored.

Definition at line 312 of file command_options.hpp.

Member Function Documentation

◆ OnlyIfAllFieldsExist() [1/2]

HsetexOptions & storages::redis::HsetexOptions::OnlyIfAllFieldsExist ( ) &
inline

Chainable modifier — FXX: write only if all of the affected fields currently exist.

Definition at line 348 of file command_options.hpp.

◆ OnlyIfAllFieldsExist() [2/2]

HsetexOptions storages::redis::HsetexOptions::OnlyIfAllFieldsExist ( ) &&
inline

FXX (rvalue overload).

Definition at line 358 of file command_options.hpp.

◆ OnlyIfNoneOfFieldsExist() [1/2]

HsetexOptions & storages::redis::HsetexOptions::OnlyIfNoneOfFieldsExist ( ) &
inline

Chainable modifier — FNX: write only if none of the affected fields currently exist.

Definition at line 342 of file command_options.hpp.

◆ OnlyIfNoneOfFieldsExist() [2/2]

HsetexOptions storages::redis::HsetexOptions::OnlyIfNoneOfFieldsExist ( ) &&
inline

FNX (rvalue overload).

Definition at line 353 of file command_options.hpp.

Member Data Documentation

◆ exist

Exist storages::redis::HsetexOptions::exist {Exist::kSetAlways}

Definition at line 327 of file command_options.hpp.

◆ ttl

std::chrono::milliseconds storages::redis::HsetexOptions::ttl {0}

Definition at line 329 of file command_options.hpp.

◆ ttl_action

TtlAction storages::redis::HsetexOptions::ttl_action {TtlAction::kNone}

Definition at line 328 of file command_options.hpp.


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