pub struct ServerEvent {
pub id: Option<String>,
pub event: String,
pub data: String,
}Expand description
One server-sent event.
Fields§
§id: Option<String>The opaque cursor after this event. Pass it back to resume from here.
event: StringThe event name; state.committed for a committed change.
data: StringThe event payload, a JSON document for state.committed.
Implementations§
Source§impl ServerEvent
impl ServerEvent
Sourcepub fn json<T: DeserializeOwned>(&self) -> Result<T>
pub fn json<T: DeserializeOwned>(&self) -> Result<T>
Decode the payload.
Trait Implementations§
Source§impl Clone for ServerEvent
impl Clone for ServerEvent
Source§impl Debug for ServerEvent
impl Debug for ServerEvent
impl Eq for ServerEvent
Source§impl PartialEq for ServerEvent
impl PartialEq for ServerEvent
impl StructuralPartialEq for ServerEvent
Auto Trait Implementations§
impl Freeze for ServerEvent
impl RefUnwindSafe for ServerEvent
impl Send for ServerEvent
impl Sync for ServerEvent
impl Unpin for ServerEvent
impl UnsafeUnpin for ServerEvent
impl UnwindSafe for ServerEvent
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