Concord - C Discord API library
A Discord API wrapper library written in C
discord_ret_dispatch Struct Reference

Generic request dispatcher. More...

#include <discord-internal.h>

Data Fields

 DISCORD_RET_DEFAULT_FIELDS
 
bool has_type
 
union {
   void(*   typed )(struct discord *client,
       struct discord_response *resp,
       const void *ret)
 
   void(*   typeless )(struct discord *client,
       struct discord_response *resp)
 
done
 
void * sync
 

Detailed Description

Generic request dispatcher.

Field Documentation

◆ DISCORD_RET_DEFAULT_FIELDS

discord_ret_dispatch::DISCORD_RET_DEFAULT_FIELDS

◆ has_type

bool discord_ret_dispatch::has_type

true if may receive a datatype from response

◆ typed

void(* discord_ret_dispatch::typed) (struct discord *client, struct discord_response *resp, const void *ret)

◆ typeless

void(* discord_ret_dispatch::typeless) (struct discord *client, struct discord_response *resp)

◆ 

union { ... } discord_ret_dispatch::done

optional callback to be executed on a successful request

Todo:
should be cast to the original callback signature before calling, otherwise its UB

◆ sync

void* discord_ret_dispatch::sync

if an address is provided, then request will block the thread and perform on-spot. On success the response object will be written to the address.


The documentation for this struct was generated from the following file: