pub struct Event { /* private fields */ }Expand description
SSE (Server-Sent Events) Payload Builder
Implementations§
Source§impl Event
impl Event
Sourcepub fn id(self, id: impl AsRef<str>) -> Self
pub fn id(self, id: impl AsRef<str>) -> Self
Set the event ID. (Optional) If the client reconnects, it will send the last event ID to the server. The server can use this ID to resume sending events from where it left off. This is useful for ensuring that the client does not miss any events in case of a disconnection.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin 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