pub struct SseSplitter { /* private fields */ }Expand description
One bounded partial SSE block. Line endings on the wire are LF.
Implementations§
Source§impl SseSplitter
impl SseSplitter
Sourcepub fn new(max_block_len: usize) -> Self
pub fn new(max_block_len: usize) -> Self
Start a splitter with the same limit used for a response DATA record.
Sourcepub fn feed(&mut self, input: &[u8]) -> Result<(usize, Option<Vec<u8>>), Error>
pub fn feed(&mut self, input: &[u8]) -> Result<(usize, Option<Vec<u8>>), Error>
Read at most one complete block and report the number of input bytes used. Pass the unread suffix to the next call.
§Errors
Returns Error::LimitExceeded if one block exceeds its bound, or
Error::InvalidConfiguration if the splitter is closed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SseSplitter
impl RefUnwindSafe for SseSplitter
impl Send for SseSplitter
impl Sync for SseSplitter
impl Unpin for SseSplitter
impl UnsafeUnpin for SseSplitter
impl UnwindSafe for SseSplitter
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