Skip to main content

take_frames

Function take_frames 

Source
pub fn take_frames(buf: &mut String) -> Vec<String>
Expand description

Split complete SSE frames off the front of buf, leaving any partial tail in place for the next read.

Handles both LF (\n\n) and CRLF (\r\n\r\n) framing; the earliest complete delimiter wins and is consumed in full. A blank line is a dispatch point in either convention, so mixed framing stays aligned.