|
co_usb
|
Awaitable for submitting transfers. More...
#include <transfer_awaitable.hpp>

Classes | |
| struct | cb_data |
Public Member Functions | |
| transfer_awaitable (libusb_transfer *tfer) noexcept | |
| bool | await_ready () noexcept |
| std::coroutine_handle | await_suspend (std::coroutine_handle<> h, boost::capy::io_env const *env) |
| suspends and submits the transfer | |
| boost::capy::io_result< size_t > | await_resume () |
| returns the result of a tranfer as an std::error_code and size of transfer's buffer contents after the operation. | |
Public Attributes | |
| libusb_transfer * | transfer = nullptr |
| struct co_usb::transfer_awaitable::cb_data | m_data |
Awaitable for submitting transfers.
This is the lowest possible representation level of an asynchronous unit of libusb. It does not care for any of a transfer's properties and does not have direction- or transfer type-related bevahioral differences.
You should use this awaitable for porting an existing codebase to co_usb or when you need ultimate control.
|
noexcept |
|
noexcept |
| boost::capy::io_result< size_t > co_usb::transfer_awaitable::await_resume | ( | ) |
returns the result of a tranfer as an std::error_code and size of transfer's buffer contents after the operation.
| std::coroutine_handle co_usb::transfer_awaitable::await_suspend | ( | std::coroutine_handle<> | h, |
| boost::capy::io_env const * | env | ||
| ) |
suspends and submits the transfer
| h | std::coroutine_handle to the awaiting coroutine |
| env | boost::capy::io_env* as per boost::capy::IoAwaitable concept |
h on submission error or on cancellation | struct co_usb::transfer_awaitable::cb_data co_usb::transfer_awaitable::m_data |
| libusb_transfer* co_usb::transfer_awaitable::transfer = nullptr |