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

Individual requests that are scheduled to run asynchronously. More...

#include <discord-internal.h>

Collaboration diagram for discord_request:
[legend]

Data Fields

struct discord_ret_dispatch dispatch
 
struct discord_ret_response response
 
struct discord_attachments attachments
 
char * reason
 
struct discord_bucketb
 
struct ccord_szbuf_reusable body
 
enum http_method method
 
char endpoint [512]
 
char key [256]
 
struct ua_conn * conn
 
CCORDcode code
 
int retry_attempt
 
pthread_cond_t * cond
 
QUEUE entry
 

Detailed Description

Individual requests that are scheduled to run asynchronously.

Note
this struct SHOULD NOT be handled from the REST manager thread
its fields are aligned with discord_attributes (see DISCORD_ATTRIBUTES_FIELDS)

Field Documentation

◆ dispatch

struct discord_ret_dispatch discord_request::dispatch

attributes set by client for request dispatch behavior

◆ response

struct discord_ret_response discord_request::response

information for parsing response into a datatype (if possible)

◆ attachments

struct discord_attachments discord_request::attachments

if HTTP_MIMEPOST provide attachments for file transfer

◆ reason

char* discord_request::reason

indicated reason to why the action was taken

Note
when used at * discord_request buffer is kept and reused

◆ b

struct discord_bucket* discord_request::b

the request's bucket

◆ body

struct ccord_szbuf_reusable discord_request::body

request body handle

Note
buffer is kept and reused

◆ method

enum http_method discord_request::method

the request's http method

◆ endpoint

char discord_request::endpoint[512]

the request's endpoint

◆ key

char discord_request::key[256]

the request bucket's key

◆ conn

struct ua_conn* discord_request::conn

the connection handler assigned

◆ code

CCORDcode discord_request::code

request's status code

◆ retry_attempt

int discord_request::retry_attempt

current retry attempt (stop at rest->retry_limit)

◆ cond

pthread_cond_t* discord_request::cond

synchronize synchronous requests

◆ entry

QUEUE discord_request::entry

entry for discord_ratelimiter and discord_bucket queues


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