struct CryBase::CouchBase::Services::KV::Response

Overview

One decoded inbound packet from the KV service. Produced by ResponseReader#read.

resp = KV::Response.new(
  opcode: KV::Opcode::Get.value,
  status: KV::Status::Success,
  cas: 0_u64,
  extras: Bytes.empty,
  key: "",
  value: "world".to_slice,
)
resp.success?          # => true
String.new(resp.value) # => "world"

Defined in:

crybase/couchbase/services/kv/response.cr:17
crybase/couchbase/services/kv/response.cr:25

Constructors

Instance Method Summary

Constructor Detail

def self.new(opcode : UInt8, status : Status, cas : UInt64, extras : Bytes, key : String, value : Bytes) #

[View source]

Instance Method Detail

def cas : UInt64 #

def clone #

[View source]
def copy_with(opcode _opcode = @opcode, status _status = @status, cas _cas = @cas, extras _extras = @extras, key _key = @key, value _value = @value) #

[View source]
def extras : Bytes #

def key : String #

def opcode : UInt8 #

def status : Status #

def success? : Bool #

[View source]
def value : Bytes #