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

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

Detailed Description

Typed view of a hiredis redisReply value.

Definition at line 26 of file reply.hpp.

Classes

class  MovableKeyValues

Public Types

enum class  Type {
  kNoReply ,
  kString ,
  kArray ,
  kInteger ,
  kNil ,
  kStatus ,
  kError
}
using Array = std::vector<ReplyData>

Public Member Functions

MovableKeyValues GetMovableKeyValues ()
 ReplyData (const redisReply *reply)
 ReplyData (Array &&array)
 ReplyData (std::string s)
 ReplyData (int value)
 operator bool () const noexcept
Type GetType () const noexcept
std::string GetTypeString () const
bool IsString () const noexcept
bool IsArray () const noexcept
bool IsInt () const noexcept
bool IsNil () const noexcept
bool IsStatus () const noexcept
bool IsError () const noexcept
bool IsUnusableInstanceError () const
bool IsReadonlyError () const
bool IsUnknownCommandError () const
bool IsErrorMoved () const
bool IsErrorAsk () const
bool IsErrorClusterdown () const
const std::string & GetString () const
std::string & GetString ()
const Array & GetArray () const
Array & GetArray ()
std::int64_t GetInt () const
const std::string & GetStatus () const
std::string & GetStatus ()
const std::string & GetError () const
std::string & GetError ()
std::size_t GetSize () const noexcept
std::string ToDebugString () const
void ExpectType (ReplyData::Type type, const std::string &request_description={}) const
void ExpectString (const std::string &request_description={}) const
void ExpectArray (const std::string &request_description={}) const
void ExpectInt (const std::string &request_description={}) const
void ExpectNil (const std::string &request_description={}) const
void ExpectStatus (const std::string &request_description={}) const
void ExpectStatusEqualTo (const std::string &expected_status_str, const std::string &request_description={}) const
void ExpectError (const std::string &request_description={}) const

Static Public Member Functions

static ReplyData CreateError (std::string &&error_msg)
static ReplyData CreateStatus (std::string &&status_msg)
static ReplyData CreateNil ()
static std::string TypeToString (Type type)

Member Typedef Documentation

◆ Array

using storages::redis::ReplyData::Array = std::vector<ReplyData>

Definition at line 28 of file reply.hpp.

Member Enumeration Documentation

◆ Type

enum class storages::redis::ReplyData::Type
strong

Definition at line 30 of file reply.hpp.

Member Function Documentation

◆ GetArray() [1/2]

Array & storages::redis::ReplyData::GetArray ( )
inline

Definition at line 145 of file reply.hpp.

◆ GetArray() [2/2]

const Array & storages::redis::ReplyData::GetArray ( ) const
inline

Definition at line 140 of file reply.hpp.

◆ GetError() [1/2]

std::string & storages::redis::ReplyData::GetError ( )
inline

Definition at line 170 of file reply.hpp.

◆ GetError() [2/2]

const std::string & storages::redis::ReplyData::GetError ( ) const
inline

Definition at line 165 of file reply.hpp.

◆ GetInt()

std::int64_t storages::redis::ReplyData::GetInt ( ) const
inline

Definition at line 150 of file reply.hpp.

◆ GetStatus() [1/2]

std::string & storages::redis::ReplyData::GetStatus ( )
inline

Definition at line 160 of file reply.hpp.

◆ GetStatus() [2/2]

const std::string & storages::redis::ReplyData::GetStatus ( ) const
inline

Definition at line 155 of file reply.hpp.

◆ GetString() [1/2]

std::string & storages::redis::ReplyData::GetString ( )
inline

Definition at line 135 of file reply.hpp.

◆ GetString() [2/2]

const std::string & storages::redis::ReplyData::GetString ( ) const
inline

Definition at line 130 of file reply.hpp.

◆ GetType()

Type storages::redis::ReplyData::GetType ( ) const
inlinenoexcept

Definition at line 108 of file reply.hpp.

◆ IsArray()

bool storages::redis::ReplyData::IsArray ( ) const
inlinenoexcept

Definition at line 115 of file reply.hpp.

◆ IsError()

bool storages::redis::ReplyData::IsError ( ) const
inlinenoexcept

Definition at line 119 of file reply.hpp.

◆ IsErrorAsk()

bool storages::redis::ReplyData::IsErrorAsk ( ) const
inline

Definition at line 126 of file reply.hpp.

◆ IsErrorClusterdown()

bool storages::redis::ReplyData::IsErrorClusterdown ( ) const
inline

Definition at line 128 of file reply.hpp.

◆ IsErrorMoved()

bool storages::redis::ReplyData::IsErrorMoved ( ) const
inline

Definition at line 124 of file reply.hpp.

◆ IsInt()

bool storages::redis::ReplyData::IsInt ( ) const
inlinenoexcept

Definition at line 116 of file reply.hpp.

◆ IsNil()

bool storages::redis::ReplyData::IsNil ( ) const
inlinenoexcept

Definition at line 117 of file reply.hpp.

◆ IsStatus()

bool storages::redis::ReplyData::IsStatus ( ) const
inlinenoexcept

Definition at line 118 of file reply.hpp.

◆ IsString()

bool storages::redis::ReplyData::IsString ( ) const
inlinenoexcept

Definition at line 114 of file reply.hpp.

◆ operator bool()

storages::redis::ReplyData::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 106 of file reply.hpp.


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