pub struct SseStream<E, S> { /* private fields */ }Expand description
A typed SSE response stream.
Wraps a Stream of Result<E, Err> and produces an
axum::response::sse::Sse response on IntoResponse. Each
stream item is serialized to JSON and framed with the event name
returned by SseEventMeta::event_name.
The SseStream newtype is what the
#[derive(SseEvent)] integration
reads at documentation-generation time to attach the
text/event-stream response and its schema to the operation —
handlers that return SseStream<E, _> get the right OpenAPI
description for free.
Keep-alive comments are enabled by default so intermediaries do
not close idle connections; swap via Self::with_keep_alive.
Implementations§
Trait Implementations§
Source§impl<E, S> DocResponseBody for SseStream<E, S>where
E: PartialSchema + ToSchema + 'static,
impl<E, S> DocResponseBody for SseStream<E, S>where
E: PartialSchema + ToSchema + 'static,
Auto Trait Implementations§
impl<E, S> !Freeze for SseStream<E, S>
impl<E, S> RefUnwindSafe for SseStream<E, S>where
S: RefUnwindSafe,
impl<E, S> Send for SseStream<E, S>where
S: Send,
impl<E, S> Sync for SseStream<E, S>where
S: Sync,
impl<E, S> Unpin for SseStream<E, S>where
S: Unpin,
impl<E, S> UnsafeUnpin for SseStream<E, S>where
S: UnsafeUnpin,
impl<E, S> UnwindSafe for SseStream<E, S>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