pub struct SseEvent { /* private fields */ }Implementations§
Source§impl SseEvent
impl SseEvent
pub fn new(data: impl Into<String>) -> Self
pub fn json<T>(data: &T) -> Result<Self>where
T: Serialize,
pub fn comment(comment: impl Into<String>) -> Self
pub fn stream<I>(events: I) -> SseStream
pub fn with_id(self, id: impl Into<String>) -> Self
pub fn with_event(self, event: impl Into<String>) -> Self
pub fn with_retry(self, retry: u64) -> Self
pub fn with_comment(self, comment: impl Into<String>) -> Self
pub fn with_data(self, data: impl Into<String>) -> Self
pub fn encode(&self) -> Vec<u8> ⓘ
Trait Implementations§
impl Eq for SseEvent
impl StructuralPartialEq for SseEvent
Auto Trait Implementations§
impl Freeze for SseEvent
impl RefUnwindSafe for SseEvent
impl Send for SseEvent
impl Sync for SseEvent
impl Unpin for SseEvent
impl UnsafeUnpin for SseEvent
impl UnwindSafe for SseEvent
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