[−][src]Struct eventsource::event::Event
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]
pub fn new() -> Event
[src]
Creates an empty event.
pub fn is_empty(&self) -> bool
[src]
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.
pub fn clear(&mut self)
[src]
Makes the event empty.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,