pub struct Event { /* private fields */ }Available on crate feature
sse only.Expand description
A single server-sent event.
Field accessors follow the SSE specification: event_type is
None for the default message type, data has had its lines joined with
\n and the trailing newline removed, and id reflects the most recent id:
field seen on the stream (it persists across events, matching EventSource.lastEventId).
Implementations§
Source§impl Event
impl Event
Sourcepub fn event_type(&self) -> Option<&str>
pub fn event_type(&self) -> Option<&str>
The event type from the event: field, or None for the default message type.
Sourcepub fn id(&self) -> Option<&str>
pub fn id(&self) -> Option<&str>
The last event id seen on the stream up to and including this event.
Sourcepub fn retry(&self) -> Option<Duration>
pub fn retry(&self) -> Option<Duration>
The server-requested reconnection time from a retry: field, if one preceded this event.
This is a connection-level directive; because EventStream does not reconnect, it is
surfaced purely informationally for callers that implement their own reconnection.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.