| 325 | } |
| 326 | |
| 327 | static PyObject* |
| 328 | pycbc_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 | |
| 351 | static PyObject* |
| 352 | pycbc_scan_iterator__cancel__(pycbc_scan_iterator* self, PyObject* args) |
nothing calls this directly
no test coverage detected