libfetch 0.0.0
A lightweight asynchronous HTTP/1.1 client library implementing a subset of the WHATWG Fetch API.
Loading...
Searching...
No Matches
fetch_promise Struct Reference

Promise for asynchronous fetch operations. More...

#include <fetch.h>

Data Fields

uint64_t promise_id
 
fetch_promise_state_t state
 
fetch_response_tresponse
 
fetch_error_t error
 
const char * error_message
 
fetch_on_fulfilled_cb on_fulfilled
 
fetch_on_rejected_cb on_rejected
 
void * userdata
 
void * internal_state
 
volatile bool detached
 

Detailed Description

Promise for asynchronous fetch operations.

Represents an ongoing or completed asynchronous HTTP request.

Note
Memory: Caller owns the promise and must call fetch_promise_free()
Threading: Promises are not thread-safe and must be used from the same thread

Field Documentation

◆ detached

volatile bool fetch_promise::detached

True if promise was freed

◆ error

fetch_error_t fetch_promise::error

Error code (if rejected)

◆ error_message

const char* fetch_promise::error_message

Error message (if rejected)

◆ internal_state

void* fetch_promise::internal_state

Internal implementation state

◆ on_fulfilled

fetch_on_fulfilled_cb fetch_promise::on_fulfilled

Success callback

◆ on_rejected

fetch_on_rejected_cb fetch_promise::on_rejected

Failure callback

◆ promise_id

uint64_t fetch_promise::promise_id

Unique promise identifier

◆ response

fetch_response_t* fetch_promise::response

Response (if fulfilled)

◆ state

fetch_promise_state_t fetch_promise::state

Current promise state

◆ userdata

void* fetch_promise::userdata

User data for callbacks


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