pub struct StreamEvent<T> {
pub last_event_id: Option<String>,
pub data: T,
}Expand description
One event a server-sent event stream delivered.
data is the event’s payload, decoded into the type the stream was
opened with. last_event_id is the SSE id in effect when the event was
dispatched: a server sets it per event, it persists over later events
that carry none, and an id field with an empty value clears it, as the
SSE processing model prescribes. A consumer that reopens the stream hands
it back through Bmc::stream_events to resume after this event. A
server that never sets one, or a transport that does not surface ids,
leaves it None throughout.
Fields§
§last_event_id: Option<String>The id to resume after this event, if the server set one.
data: TThe event’s decoded payload.
Trait Implementations§
Source§impl<T: Clone> Clone for StreamEvent<T>
impl<T: Clone> Clone for StreamEvent<T>
Source§impl<T: Debug> Debug for StreamEvent<T>
impl<T: Debug> Debug for StreamEvent<T>
impl<T: Eq> Eq for StreamEvent<T>
Source§impl<T: PartialEq> PartialEq for StreamEvent<T>
impl<T: PartialEq> PartialEq for StreamEvent<T>
impl<T: PartialEq> StructuralPartialEq for StreamEvent<T>
Auto Trait Implementations§
impl<T> Forget for StreamEvent<T>
impl<T> Freeze for StreamEvent<T>where
T: Freeze,
impl<T> Move for StreamEvent<T>
impl<T> RefUnwindSafe for StreamEvent<T>where
T: RefUnwindSafe,
impl<T> Send for StreamEvent<T>where
T: Send,
impl<T> Sync for StreamEvent<T>where
T: Sync,
impl<T> Unpin for StreamEvent<T>where
T: Unpin,
impl<T> UnsafeUnpin for StreamEvent<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for StreamEvent<T>where
T: UnwindSafe,
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