MCPcopy Create free account
hub / github.com/couchbase/couchbase-python-client / pycbc_scan_iterator__iternext__

Function pycbc_scan_iterator__iternext__

src/result.cxx:327–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327static PyObject*
328pycbc_scan_iterator__iternext__(PyObject* self)
329{
330 pycbc_scan_iterator* scan_iter = reinterpret_cast<pycbc_scan_iterator*>(self);
331
332 tl::expected<couchbase::core::range_scan_item, std::error_code> result;
333 {
334 Py_BEGIN_ALLOW_THREADS result = scan_iter->scan_result->next();
335 Py_END_ALLOW_THREADS
336 }
337
338 if (!result.has_value()) {
339 return build_exception(
340 result.error(), __FILE__, __LINE__, "Error retrieving next scan result item.");
341 }
342 PyObject* pyObj = create_pycbc_result();
343 if (pyObj == nullptr) {
344 return nullptr;
345 }
346 pycbc_result* res = reinterpret_cast<pycbc_result*>(pyObj);
347 add_field<couchbase::core::range_scan_item>(res->raw_result, "scan_item", result.value());
348 return reinterpret_cast<PyObject*>(res);
349}
350
351static PyObject*
352pycbc_scan_iterator__cancel__(pycbc_scan_iterator* self, PyObject* args)

Callers

nothing calls this directly

Calls 4

build_exceptionFunction · 0.85
create_pycbc_resultFunction · 0.85
errorMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected