SDL_AsyncIOOutcome(3type)
π SDL_AsyncIOOutcome π
okay bestie, welcome to SDL_AsyncIOOutcome β it's a datatype from the SDL3 family (the whole SDL3 DATATYPES squad, iykyk) and it's literally just the lil receipt you get back when an asynchronous I/O request finishes. no cap. π
β¨ NAME β¨
SDL_AsyncIOOutcome β all the info about an asynchronous I/O request that's already done and dusted. π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_asyncio.h>
typedef struct SDL_AsyncIOOutcome
{
SDL_AsyncIO *asyncio; /**< what generated this task. This pointer will be invalid if it was closed! */
SDL_AsyncIOTaskType type; /**< What sort of task was this? Read, write, etc? */
SDL_AsyncIOResult result; /**< the result of the work (success, failure, cancellation). */
void *buffer; /**< buffer where data was read/written. */
Uint64 offset; /**< offset in the SDL_AsyncIO where data was read/written. */
Uint64 bytes_requested; /**< number of bytes the task was to read/write. */
Uint64 bytes_transferred; /**< actual number of bytes that were read/written. */
void *userdata; /**< pointer provided by the app when starting the task */
} SDL_AsyncIOOutcome;
πΈ DESCRIPTION πΈ
so like, when you kick off an async I/O task and it finally comes back to you, this struct is the whole story. it's giving "here's everything that went down while you were waiting." let's go field by field, bestie, because every single one matters. π«Ά
SDL_AsyncIO *asyncioβ the thing that generated this task. but bestie, listen: this pointer will be invalid if it was closed! π so don't go dereferencing it after you closed the handle, fr fr.SDL_AsyncIOTaskType typeβ what sort of task was this even? read? write? etc? vibe check on the task type. π₯SDL_AsyncIOResult resultβ the result of the work. could be success, failure, or cancellation. that's the tea. πvoid *bufferβ the buffer where the data was read into or written from. the actual hangout spot for your bytes. πUint64 offsetβ the offset in theSDL_AsyncIOwhere the data was read/written. where in the file we were, basically. βUint64 bytes_requestedβ how many bytes the task was supposed to read/write. the plan. β¨Uint64 bytes_transferredβ the actual number of bytes that got read/written. the reality. and yeah, plan β reality sometimes, that's why both exist. πvoid *userdataβ the pointer you (the app) handed over when starting the task. your lil note-to-self, returned safely. π
π AVAILABILITY π
this struct has been around since SDL 3.2.0. iconic behavior honestly. π
heads up bestie: that asyncio pointer being invalid after close is NOT a drill. if you closed it, it's gone gone. π«Ά
that's the whole page, no notes. mwah. π β¨
Simple Directmedia Layer, SDL 3.4.18 β shoutout to the SDL3 DATATYPES era, this page was served fresh and cute, tysm for reading, ily, bye bestie!! π¦ππΈ
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms