pub struct Event { /* private fields */ }Expand description
One server-sent event
Implementations§
Source§impl Event
impl Event
Sourcepub fn json<T: Serialize>(value: &T) -> Result<Self>
pub fn json<T: Serialize>(value: &T) -> Result<Self>
An event whose data is value serialized as JSON
Sourcepub fn comment(text: impl Into<String>) -> Self
pub fn comment(text: impl Into<String>) -> Self
A comment line, ignored by EventSource; useful as a keep-alive
Sourcepub fn event(self, name: impl Into<String>) -> Self
pub fn event(self, name: impl Into<String>) -> Self
Event name, delivered to addEventListener(name, ...)
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
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.