std1.0.0-beta-7 SafeC docs

std :: http::sse

Struct std::SseParser

#include <std/http/sse.h> source

struct SseParser {
    struct String buf;
    struct String data;
    struct String event;
    struct String last_id;
    int has_data;
    int retry;
}

Fields

§struct String bufsource

unconsumed bytes

§struct String datasource
§struct String eventsource
§struct String last_idsource
§int has_datasource
§int retrysource

Methods

§static struct SseParser new()source · definition
§void feed([]const unsigned char bytes)source · definition

Adds received bytes.

§int next(&SseEvent out)source · definition

The next complete event (1, 'out' filled — free it) or 0 if more input is needed. Comment lines and events without data are skipped.

§void drop()source · definition
§void free() consumesource · definition

= drop()