#[non_exhaustive]pub struct SseFrame {
pub event: SseEvent,
pub id: Option<String>,
}Expand description
A parsed SSE frame: the event and the id: line value (if any).
§id field semantics
RFC 8895 §9.2 distinguishes three id states:
- A frame with no
id:field → last event ID is unchanged. - A frame with a bare
id:field (no value) → last event ID is reset. - A frame with
id: <value>→ last event ID is updated to<value>.
This implementation conflates the first two cases: both produce id: None.
Callers implementing reconnect with Last-Event-ID should treat None as
“no change” and retain the previously-seen ID. The “reset” semantic is not
representable without a tri-state type; this simplification is intentional
for JMAP, where bare id: reset frames are rare in practice.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.event: SseEvent§id: Option<String>Trait Implementations§
impl Eq for SseFrame
impl StructuralPartialEq for SseFrame
Auto Trait Implementations§
impl Freeze for SseFrame
impl RefUnwindSafe for SseFrame
impl Send for SseFrame
impl Sync for SseFrame
impl Unpin for SseFrame
impl UnsafeUnpin for SseFrame
impl UnwindSafe for SseFrame
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
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§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.