pub struct Event<T> {
pub id: Option<Cow<'static, str>>,
pub name: Cow<'static, str>,
pub data: T,
}Expand description
Represents an SSE event.
Fields§
§id: Option<Cow<'static, str>>Clients should record this value and send it on future connections as the Last-Event-ID header.
If no id has been set, this property is None.
If another event is dispatched without an id field, the previous id will be used.
See Last-Event-ID
name: Cow<'static, str>If no name field is sent by the stream, "message" will be used.
data: TContains the value of all of the data fields received for this event joined by a newline ('\n').
Trait Implementations§
Source§impl<T> Ord for Event<T>where
T: Ord,
impl<T> Ord for Event<T>where
T: Ord,
Source§impl<T> PartialOrd for Event<T>where
T: PartialOrd,
impl<T> PartialOrd for Event<T>where
T: PartialOrd,
impl<T> Eq for Event<T>where
T: Eq,
Auto Trait Implementations§
impl<T> Freeze for Event<T>where
T: Freeze,
impl<T> RefUnwindSafe for Event<T>where
T: RefUnwindSafe,
impl<T> Send for Event<T>where
T: Send,
impl<T> Sync for Event<T>where
T: Sync,
impl<T> Unpin for Event<T>where
T: Unpin,
impl<T> UnwindSafe for Event<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