Class: Rdkafka::Callbacks::DeleteAclResult

Inherits:
Object
  • Object
show all
Defined in:
lib/rdkafka/callbacks.rb

Overview

Extracts attributes of rd_kafka_DeleteAcls_result_response_t

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(acl_result_pointer) ⇒ DeleteAclResult

Returns a new instance of DeleteAclResult.

Parameters:

  • acl_result_pointer (FFI::Pointer)

    pointer to the delete ACL result response struct



94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/rdkafka/callbacks.rb', line 94

def initialize(acl_result_pointer)
  @matching_acls = []
  rd_kafka_error_pointer = Rdkafka::Bindings.rd_kafka_DeleteAcls_result_response_error(acl_result_pointer)
  @result_error = Rdkafka::Bindings.rd_kafka_error_code(rd_kafka_error_pointer)
  @error_string = Rdkafka::Bindings.rd_kafka_error_string(rd_kafka_error_pointer)
  if @result_error == Rdkafka::Bindings::RD_KAFKA_RESP_ERR_NO_ERROR
    # Get the number of matching acls
    pointer_to_size_t = FFI::MemoryPointer.new(:int32)
    @matching_acls = Rdkafka::Bindings.rd_kafka_DeleteAcls_result_response_matching_acls(acl_result_pointer, pointer_to_size_t)
    @matching_acls_count = pointer_to_size_t.read_int
  end
end

Instance Attribute Details

#error_stringObject (readonly)

Returns the value of attribute error_string.



91
92
93
# File 'lib/rdkafka/callbacks.rb', line 91

def error_string
  @error_string
end

#matching_aclsObject (readonly)

Returns the value of attribute matching_acls.



91
92
93
# File 'lib/rdkafka/callbacks.rb', line 91

def matching_acls
  @matching_acls
end

#matching_acls_countObject (readonly)

Returns the value of attribute matching_acls_count.



91
92
93
# File 'lib/rdkafka/callbacks.rb', line 91

def matching_acls_count
  @matching_acls_count
end

#result_errorObject (readonly)

Returns the value of attribute result_error.



91
92
93
# File 'lib/rdkafka/callbacks.rb', line 91

def result_error
  @result_error
end

Class Method Details

.delete_acl_results_from_array(count, array_pointer) ⇒ Array<DeleteAclResult>

Returns array of delete ACL results.

Parameters:

  • count (Integer)

    number of results

  • array_pointer (FFI::Pointer)

    pointer to the results array

Returns:



110
111
112
113
114
115
# File 'lib/rdkafka/callbacks.rb', line 110

def self.delete_acl_results_from_array(count, array_pointer)
  (1..count).map do |index|
    result_pointer = (array_pointer + (index - 1)).read_pointer
    new(result_pointer)
  end
end