pub struct Event {
pub event: String,
pub data: String,
pub id: String,
pub retry: Option<Duration>,
}Expand description
One dispatched server-sent event.
The four fields carry the per-event state of the WHATWG processing model: event type, data, last event ID, and reconnection time.
Fields§
§event: StringEvent type. "message" when the stream set no event field for this
block, or set it to the empty string.
data: StringEvent data: the data lines of the block joined with \n, with the
trailing \n removed.
id: StringThe last event ID string at the time of dispatch. Empty until the
stream sends an id field (or the parser is seeded with one).
retry: Option<Duration>The most recent reconnection time processed since the previous
dispatched event, if any. Use SseParser::retry
for the current stream-level value.
Trait Implementations§
impl Eq for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more