pub struct SseDecoder { /* private fields */ }Expand description
Push-based decoder: feed bytes, receive completed events.
Implementations§
Source§impl SseDecoder
impl SseDecoder
Sourcepub fn new(max_line_bytes: usize) -> Self
pub fn new(max_line_bytes: usize) -> Self
Decoder bounding each line; events are unbounded (use Self::with_limits).
Sourcepub fn with_limits(max_line_bytes: usize, max_event_bytes: usize) -> Self
pub fn with_limits(max_line_bytes: usize, max_event_bytes: usize) -> Self
Decoder bounding each line and the accumulated bytes of one event (event name plus all data lines, one separator byte per line).
pub fn push(&mut self, bytes: &[u8]) -> Result<Vec<SseEvent>, HttpError>
Trait Implementations§
Source§impl Debug for SseDecoder
impl Debug for SseDecoder
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