pub struct SseEvent { /* private fields */ }Expand description
One Server-Sent Event frame with optional id, event type, retry hint, comment, and data payload.
Implementations§
Source§impl SseEvent
Inherent implementation of SseEvent.
impl SseEvent
Inherent implementation of SseEvent.
Sourcepub fn comment_only<C>(comment: C) -> Self
pub fn comment_only<C>(comment: C) -> Self
Sourcepub fn with_event<E>(self, event: E) -> Self
pub fn with_event<E>(self, event: E) -> Self
Sourcepub fn with_retry(self, retry_ms: u64) -> Self
pub fn with_retry(self, retry_ms: u64) -> Self
Sourcepub fn encode_into(&self, out: &mut Vec<u8>)
pub fn encode_into(&self, out: &mut Vec<u8>)
Encodes this event directly into out using SWAR line-break scanning with zero intermediate allocations.
§Arguments
&mut Vec<u8>- Reusable wire buffer (cleared before writing).
Source§impl SseEvent
impl SseEvent
pub fn get_id(&self) -> Option<String>
pub fn try_get_id(&self) -> Option<String>
pub fn get_mut_id(&mut self) -> &mut Option<String>
pub fn set_id(&mut self, val: Option<String>) -> &mut Self
pub fn get_event(&self) -> Option<String>
pub fn try_get_event(&self) -> Option<String>
pub fn get_mut_event(&mut self) -> &mut Option<String>
pub fn set_event(&mut self, val: Option<String>) -> &mut Self
pub fn get_data(&self) -> &String
pub fn get_mut_data(&mut self) -> &mut String
pub fn set_data(&mut self, val: String) -> &mut Self
pub fn get_retry(&self) -> Option<u64>
pub fn try_get_retry(&self) -> Option<u64>
pub fn get_mut_retry(&mut self) -> &mut Option<u64>
pub fn set_retry(&mut self, val: Option<u64>) -> &mut Self
pub fn get_comment(&self) -> Option<String>
pub fn try_get_comment(&self) -> Option<String>
pub fn get_mut_comment(&mut self) -> &mut Option<String>
pub fn set_comment(&mut self, val: Option<String>) -> &mut Self
Trait Implementations§
impl Eq for SseEvent
impl StructuralPartialEq for SseEvent
Auto Trait Implementations§
impl Forget for SseEvent
impl Freeze for SseEvent
impl Move for SseEvent
impl RefUnwindSafe for SseEvent
impl Send for SseEventwhere
RawVecInner: Send,
impl Sync for SseEventwhere
RawVecInner: Sync,
impl Unpin for SseEvent
impl UnsafeUnpin for SseEvent
impl UnwindSafe for SseEventwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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.