D++ (DPP)
C++ Discord API Bot Library
|
State of the async and its callback. More...
Public Member Functions | |
template<typename... Ts> | |
void | construct_result (Ts &&... ts) |
Convenience function to construct the result in the storage and initialize its lifetime. More... | |
~async_callback_data () | |
Destructor. More... | |
Public Attributes | |
std::atomic< int > | ref_count {1} |
Number of references to this callback state. More... | |
std::atomic< state_t > | state = state_t::sent |
State of the awaitable and the API callback. More... | |
std::array< std::byte, sizeof(R)> | result_storage |
The stored result of the API call, stored as an array of bytes to directly construct in place. More... | |
std_coroutine::coroutine_handle | coro_handle = nullptr |
Handle to the coroutine co_await-ing on this API call. More... | |
State of the async and its callback.
Defined outside of dpp::async because this seems to work better with Intellisense.
|
inline |
Destructor.
Also destroys the result if present.
|
inline |
Convenience function to construct the result in the storage and initialize its lifetime.
std_coroutine::coroutine_handle dpp::detail::async::async_callback_data< R >::coro_handle = nullptr |
Handle to the coroutine co_await-ing on this API call.
std::atomic<int> dpp::detail::async::async_callback_data< R >::ref_count {1} |
Number of references to this callback state.
std::array<std::byte, sizeof(R)> dpp::detail::async::async_callback_data< R >::result_storage |
The stored result of the API call, stored as an array of bytes to directly construct in place.
std::atomic<state_t> dpp::detail::async::async_callback_data< R >::state = state_t::sent |
State of the awaitable and the API callback.