Struct eventsource::event::Event
[−]
[src]
pub struct Event { pub id: Option<String>, pub event_type: Option<String>, pub data: String, }
A single Server-Sent Event.
Fields
id: Option<String>
Corresponds to the id
field.
event_type: Option<String>
Corresponds to the event
field.
data: String
All data
fields concatenated by newlines.
Methods
impl Event
[src]
fn new() -> Event
Creates an empty event.
fn is_empty(&self) -> bool
Returns true
if the event is empty.
An event is empty if it has no id or event type and its data field is empty.
fn clear(&mut self)
Makes the event empty.