OxL Справочник OxL
РусскийEnglish

data SseEvent

One event received from an event stream.

Example:

oxl✓ проверяется в CI
use std.http { SseEvent }

fn main() io {
  let e = SseEvent{ text: "hello" }
  print("{e.name} {e.text} {e.retry}")
}
Вывод
message hello -1
pub(api) data SseEvent

С версии. 1.0.0-beta

Поля

pub(api) name: str = "message"

The event: field; message when absent.

pub(api) text: str = ""

The data: lines joined with \n.

pub(api) id: str = ""

The id: field; empty when absent.

pub(api) retry: i64 = -1

The last retry: value in milliseconds, -1 when none was sent.

Определено в: std/http/http.oxl:4712

См. также