dpp::detail::event_router::awaitable
event_router.h
typename T
class friend class event_router_t< T > event_router_t< T > dpp::detail::event_router::awaitable::event_router_t< T > event_router_t< T >
const T * const T* dpp::detail::event_router::awaitable< T >::event event dpp::detail::event_router::awaitable::event = nullptr

Event that triggered a resumption, to give to the resumer.

void * void* dpp::detail::event_router::awaitable< T >::handle handle dpp::detail::event_router::awaitable::handle = nullptr

Coroutine handle, type-erased.

std::function< bool(const T &)> std::function<bool (const T &)> dpp::detail::event_router::awaitable< T >::predicate predicate dpp::detail::event_router::awaitable::predicate = nullptr

Predicate on the event, or nullptr for always match.

event_router_t< T > * event_router_t<T>* dpp::detail::event_router::awaitable< T >::self self dpp::detail::event_router::awaitable::self

Event router that will manage this object.

std::atomic< awaiter_state > std::atomic<awaiter_state> dpp::detail::event_router::awaitable< T >::state state dpp::detail::event_router::awaitable::state = awaiter_state::none

The state of the awaiting coroutine.

dpp::detail::event_router::awaitable< T >::awaitable
()=default
awaitable
dpp::detail::event_router::awaitable::awaitable

Default constructor is accessible only to event_router_t

typename F
dpp::detail::event_router::awaitable< T >::awaitable
(event_router_t< T > *router, F &&fun)
awaitable
dpp::detail::event_router::awaitable::awaitable
event_router_t< T > * router
F && fun

Normal constructor is accessible only to event_router_t

void void dpp::detail::event_router::awaitable< T >::resume () resume dpp::detail::event_router::awaitable::resume

Resume the coroutine waiting on this object.

dpp::detail::event_router::awaitable< T >::awaitable
(awaitable &&rhs) noexcept
awaitable
dpp::detail::event_router::awaitable::awaitable
awaitable && rhs

Move constructor.

dpp::detail::event_router::awaitable< T >::awaitable
(const awaitable &)=delete
awaitable
dpp::detail::event_router::awaitable::awaitable
const awaitable &

This object is not copyable.

bool bool dpp::detail::event_router::awaitable< T >::await_ready () const noexcept await_ready dpp::detail::event_router::awaitable::await_ready

First function called by the standard library when awaiting this object. Returns true if we need to suspend.

false

always.

const T & const T & dpp::detail::event_router::awaitable< T >::await_resume () await_resume dpp::detail::event_router::awaitable::await_resume

Third and final function called by the standard library, called when resuming the coroutine.

ref task_cancelled_exception if cancel() has been called

const T& Reference to the event that matched

void void dpp::detail::event_router::awaitable< T >::await_suspend (detail::std_coroutine::coroutine_handle<> caller) await_suspend dpp::detail::event_router::awaitable::await_suspend detail::std_coroutine::coroutine_handle<> caller

Second function called by the standard library when awaiting this object, after suspension. This will attach the object to its event router, to be resumed on the next event that satisfies the predicate.

void never resume on call.

void void dpp::detail::event_router::awaitable< T >::cancel () cancel dpp::detail::event_router::awaitable::cancel

Request cancellation. This will detach this object from the event router and resume the awaiter, which will be thrown dpp::task_cancelled::exception.

???

As this resumes the coroutine, it may throw any exceptions at the caller.

If state == none (was never awaited), do nothing If state == waiting, prevent resumption, resume on our end If state == resuming || cancelling, ignore

awaitable & awaitable & dpp::detail::event_router::awaitable< T >::operator= (awaitable &&rhs) noexcept operator= dpp::detail::event_router::awaitable::operator= awaitable && rhs

Move assignment operator.

awaitable & awaitable & dpp::detail::event_router::awaitable< T >::operator= (const awaitable &)=delete operator= dpp::detail::event_router::awaitable::operator= const awaitable &

This object is not copyable.

Awaitable object representing an event. A user can co_await on this object to resume the next time the event is fired, optionally with a condition.

dpp::detail::event_router::awaitable< T >
dpp::detail::event_router::awaitable< dpp::autocomplete_t >
< dpp::autocomplete_t >
dpp::detail::event_router::awaitable< dpp::automod_rule_create_t >
< dpp::automod_rule_create_t >
dpp::detail::event_router::awaitable< dpp::automod_rule_delete_t >
< dpp::automod_rule_delete_t >
dpp::detail::event_router::awaitable< dpp::automod_rule_execute_t >
< dpp::automod_rule_execute_t >
dpp::detail::event_router::awaitable< dpp::automod_rule_update_t >
< dpp::automod_rule_update_t >
dpp::detail::event_router::awaitable< dpp::button_click_t >
< dpp::button_click_t >
dpp::detail::event_router::awaitable< dpp::channel_create_t >
< dpp::channel_create_t >
dpp::detail::event_router::awaitable< dpp::channel_delete_t >
< dpp::channel_delete_t >
dpp::detail::event_router::awaitable< dpp::channel_pins_update_t >
< dpp::channel_pins_update_t >
dpp::detail::event_router::awaitable< dpp::channel_update_t >
< dpp::channel_update_t >
dpp::detail::event_router::awaitable< dpp::entitlement_create_t >
< dpp::entitlement_create_t >
dpp::detail::event_router::awaitable< dpp::entitlement_delete_t >
< dpp::entitlement_delete_t >
dpp::detail::event_router::awaitable< dpp::entitlement_update_t >
< dpp::entitlement_update_t >
dpp::detail::event_router::awaitable< dpp::form_submit_t >
< dpp::form_submit_t >
dpp::detail::event_router::awaitable< dpp::guild_audit_log_entry_create_t >
< dpp::guild_audit_log_entry_create_t >
dpp::detail::event_router::awaitable< dpp::guild_ban_add_t >
< dpp::guild_ban_add_t >
dpp::detail::event_router::awaitable< dpp::guild_ban_remove_t >
< dpp::guild_ban_remove_t >
dpp::detail::event_router::awaitable< dpp::guild_create_t >
< dpp::guild_create_t >
dpp::detail::event_router::awaitable< dpp::guild_delete_t >
< dpp::guild_delete_t >
dpp::detail::event_router::awaitable< dpp::guild_emojis_update_t >
< dpp::guild_emojis_update_t >
dpp::detail::event_router::awaitable< dpp::guild_integrations_update_t >
< dpp::guild_integrations_update_t >
dpp::detail::event_router::awaitable< dpp::guild_join_request_delete_t >
< dpp::guild_join_request_delete_t >
dpp::detail::event_router::awaitable< dpp::guild_member_add_t >
< dpp::guild_member_add_t >
dpp::detail::event_router::awaitable< dpp::guild_member_remove_t >
< dpp::guild_member_remove_t >
dpp::detail::event_router::awaitable< dpp::guild_member_update_t >
< dpp::guild_member_update_t >
dpp::detail::event_router::awaitable< dpp::guild_members_chunk_t >
< dpp::guild_members_chunk_t >
dpp::detail::event_router::awaitable< dpp::guild_role_create_t >
< dpp::guild_role_create_t >
dpp::detail::event_router::awaitable< dpp::guild_role_delete_t >
< dpp::guild_role_delete_t >
dpp::detail::event_router::awaitable< dpp::guild_role_update_t >
< dpp::guild_role_update_t >
dpp::detail::event_router::awaitable< dpp::guild_scheduled_event_create_t >
< dpp::guild_scheduled_event_create_t >
dpp::detail::event_router::awaitable< dpp::guild_scheduled_event_delete_t >
< dpp::guild_scheduled_event_delete_t >
dpp::detail::event_router::awaitable< dpp::guild_scheduled_event_update_t >
< dpp::guild_scheduled_event_update_t >
dpp::detail::event_router::awaitable< dpp::guild_scheduled_event_user_add_t >
< dpp::guild_scheduled_event_user_add_t >
dpp::detail::event_router::awaitable< dpp::guild_scheduled_event_user_remove_t >
< dpp::guild_scheduled_event_user_remove_t >
dpp::detail::event_router::awaitable< dpp::guild_stickers_update_t >
< dpp::guild_stickers_update_t >
dpp::detail::event_router::awaitable< dpp::guild_update_t >
< dpp::guild_update_t >
dpp::detail::event_router::awaitable< dpp::integration_create_t >
< dpp::integration_create_t >
dpp::detail::event_router::awaitable< dpp::integration_delete_t >
< dpp::integration_delete_t >
dpp::detail::event_router::awaitable< dpp::integration_update_t >
< dpp::integration_update_t >
dpp::detail::event_router::awaitable< dpp::interaction_create_t >
< dpp::interaction_create_t >
dpp::detail::event_router::awaitable< dpp::invite_create_t >
< dpp::invite_create_t >
dpp::detail::event_router::awaitable< dpp::invite_delete_t >
< dpp::invite_delete_t >
dpp::detail::event_router::awaitable< dpp::log_t >
< dpp::log_t >
dpp::detail::event_router::awaitable< dpp::message_context_menu_t >
< dpp::message_context_menu_t >
dpp::detail::event_router::awaitable< dpp::message_create_t >
< dpp::message_create_t >
dpp::detail::event_router::awaitable< dpp::message_delete_bulk_t >
< dpp::message_delete_bulk_t >
dpp::detail::event_router::awaitable< dpp::message_delete_t >
< dpp::message_delete_t >
dpp::detail::event_router::awaitable< dpp::message_poll_vote_add_t >
< dpp::message_poll_vote_add_t >
dpp::detail::event_router::awaitable< dpp::message_poll_vote_remove_t >
< dpp::message_poll_vote_remove_t >
dpp::detail::event_router::awaitable< dpp::message_reaction_add_t >
< dpp::message_reaction_add_t >
dpp::detail::event_router::awaitable< dpp::message_reaction_remove_all_t >
< dpp::message_reaction_remove_all_t >
dpp::detail::event_router::awaitable< dpp::message_reaction_remove_emoji_t >
< dpp::message_reaction_remove_emoji_t >
dpp::detail::event_router::awaitable< dpp::message_reaction_remove_t >
< dpp::message_reaction_remove_t >
dpp::detail::event_router::awaitable< dpp::message_update_t >
< dpp::message_update_t >
dpp::detail::event_router::awaitable< dpp::presence_update_t >
< dpp::presence_update_t >
dpp::detail::event_router::awaitable< dpp::ready_t >
< dpp::ready_t >
dpp::detail::event_router::awaitable< dpp::resumed_t >
< dpp::resumed_t >
dpp::detail::event_router::awaitable< dpp::select_click_t >
< dpp::select_click_t >
dpp::detail::event_router::awaitable< dpp::slashcommand_t >
< dpp::slashcommand_t >
dpp::detail::event_router::awaitable< dpp::socket_close_t >
< dpp::socket_close_t >
dpp::detail::event_router::awaitable< dpp::stage_instance_create_t >
< dpp::stage_instance_create_t >
dpp::detail::event_router::awaitable< dpp::stage_instance_delete_t >
< dpp::stage_instance_delete_t >
dpp::detail::event_router::awaitable< dpp::stage_instance_update_t >
< dpp::stage_instance_update_t >
dpp::detail::event_router::awaitable< dpp::thread_create_t >
< dpp::thread_create_t >
dpp::detail::event_router::awaitable< dpp::thread_delete_t >
< dpp::thread_delete_t >
dpp::detail::event_router::awaitable< dpp::thread_list_sync_t >
< dpp::thread_list_sync_t >
dpp::detail::event_router::awaitable< dpp::thread_member_update_t >
< dpp::thread_member_update_t >
dpp::detail::event_router::awaitable< dpp::thread_members_update_t >
< dpp::thread_members_update_t >
dpp::detail::event_router::awaitable< dpp::thread_update_t >
< dpp::thread_update_t >
dpp::detail::event_router::awaitable< dpp::typing_start_t >
< dpp::typing_start_t >
dpp::detail::event_router::awaitable< dpp::user_context_menu_t >
< dpp::user_context_menu_t >
dpp::detail::event_router::awaitable< dpp::user_update_t >
< dpp::user_update_t >
dpp::detail::event_router::awaitable< dpp::voice_buffer_send_t >
< dpp::voice_buffer_send_t >
dpp::detail::event_router::awaitable< dpp::voice_channel_effect_send_t >
< dpp::voice_channel_effect_send_t >
dpp::detail::event_router::awaitable< dpp::voice_client_disconnect_t >
< dpp::voice_client_disconnect_t >
dpp::detail::event_router::awaitable< dpp::voice_client_platform_t >
< dpp::voice_client_platform_t >
dpp::detail::event_router::awaitable< dpp::voice_client_speaking_t >
< dpp::voice_client_speaking_t >
dpp::detail::event_router::awaitable< dpp::voice_ready_t >
< dpp::voice_ready_t >
dpp::detail::event_router::awaitable< dpp::voice_receive_t >
< dpp::voice_receive_t >
dpp::detail::event_router::awaitable< dpp::voice_server_update_t >
< dpp::voice_server_update_t >
dpp::detail::event_router::awaitable< dpp::voice_state_update_t >
< dpp::voice_state_update_t >
dpp::detail::event_router::awaitable< dpp::voice_track_marker_t >
< dpp::voice_track_marker_t >
dpp::detail::event_router::awaitable< dpp::webhooks_update_t >
< dpp::webhooks_update_t >
- dpp::detail::event_router::awaitable
  await_ready
- dpp::detail::event_router::awaitable
  await_resume
- dpp::detail::event_router::awaitable
  await_suspend
- dpp::detail::event_router::awaitable
  awaitable
- dpp::detail::event_router::awaitable
  awaitable
- dpp::detail::event_router::awaitable
  awaitable
- dpp::detail::event_router::awaitable
  awaitable
- dpp::detail::event_router::awaitable
  cancel
- dpp::detail::event_router::awaitable
  event
- dpp::detail::event_router::awaitable
  event_router_t< T >
- dpp::detail::event_router::awaitable
  handle
- dpp::detail::event_router::awaitable
  operator=
- dpp::detail::event_router::awaitable
  operator=
- dpp::detail::event_router::awaitable
  predicate
- dpp::detail::event_router::awaitable
  resume
- dpp::detail::event_router::awaitable
  self
- dpp::detail::event_router::awaitable
  state