pub struct SseStream<S, B, E>{ /* private fields */ }Available on crate feature
stream only.Expand description
Adapts a fallible byte stream into a stream of parsed SseEvents.
Errors from the underlying byte stream are forwarded unchanged. When the byte stream ends, any buffered-but-undispatched data is discarded per the SSE specification.
The adapter keeps a single scratch Vec that the parser writes into on
every poll and a VecDeque it drains from, so steady-state polling performs
no per-chunk heap allocation beyond the events themselves.
Implementations§
Trait Implementations§
Source§impl<S, B, E> Stream for SseStream<S, B, E>
impl<S, B, E> Stream for SseStream<S, B, E>
Auto Trait Implementations§
impl<S, B, E> Freeze for SseStream<S, B, E>where
S: Freeze,
impl<S, B, E> RefUnwindSafe for SseStream<S, B, E>where
S: RefUnwindSafe,
impl<S, B, E> Send for SseStream<S, B, E>where
S: Send,
impl<S, B, E> Sync for SseStream<S, B, E>where
S: Sync,
impl<S, B, E> Unpin for SseStream<S, B, E>where
S: Unpin,
impl<S, B, E> UnsafeUnpin for SseStream<S, B, E>where
S: UnsafeUnpin,
impl<S, B, E> UnwindSafe for SseStream<S, B, E>where
S: UnwindSafe,
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