pub struct SseDecoder { /* private fields */ }Expand description
Incremental Server-Sent Events decoder.
Accumulates event: and data: field lines and emits an SseEvent when a
blank line terminates the record (standard SSE dispatch). Multiple data:
lines within one record are joined with \n. Comment lines (those starting
with :) and unknown fields are ignored. Field values have a single leading
space after the colon stripped, per the SSE specification.
push does the newline framing internally via LineDecoder; callers that
already have whole lines can use push_line.
Implementations§
Source§impl SseDecoder
impl SseDecoder
Sourcepub fn push(&mut self, bytes: &[u8]) -> Vec<SseEvent>
pub fn push(&mut self, bytes: &[u8]) -> Vec<SseEvent>
Feed raw bytes; return any records completed by blank lines.
Trait Implementations§
Source§impl Debug for SseDecoder
impl Debug for SseDecoder
Source§impl Default for SseDecoder
impl Default for SseDecoder
Source§fn default() -> SseDecoder
fn default() -> SseDecoder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SseDecoder
impl RefUnwindSafe for SseDecoder
impl Send for SseDecoder
impl Sync for SseDecoder
impl Unpin for SseDecoder
impl UnsafeUnpin for SseDecoder
impl UnwindSafe for SseDecoder
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