pub struct SseParser { /* private fields */ }Expand description
An incremental Server-Sent Events reader: feed it bytes as they arrive and take whole frames out.
The fields are read by eventsource_stream. In front of it a framer
of ours splits lines (\n, \r\n or \r, even split across chunks),
strips a leading BOM, holds a frame until its blank line, and drops
whole any frame past MAX_LINE_BYTES or MAX_FRAME_BYTES:
eventsource_stream buffers without limit, so nothing reaches it but
whole frames under the caps. Invalid UTF-8 is replaced, not refused.
A frame with data is returned. One without is returned only for its
retry:, which eventsource_stream would otherwise drop; its id:
carries over to the next frame.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SseParser
impl !UnwindSafe for SseParser
impl Freeze for SseParser
impl Send for SseParser
impl Sync for SseParser
impl Unpin for SseParser
impl UnsafeUnpin for SseParser
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