[][src]Struct eventsource::event::Event

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]

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

impl Debug for Event[src]

impl Display for Event[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.