pub struct SseResponse<S> { /* private fields */ }Expand description
Implementations§
Source§impl<S> SseResponse<S>
impl<S> SseResponse<S>
Sourcepub fn with_config(stream: S, config: SseConfig) -> Self
pub fn with_config(stream: S, config: SseConfig) -> Self
Create an SSE response with custom configuration.
Sourcepub fn into_response(self) -> Response
pub fn into_response(self) -> Response
Convert to an HTTP Response.
Sets the appropriate headers for SSE:
Content-Type: text/event-streamCache-Control: no-cacheConnection: keep-alive
Auto Trait Implementations§
impl<S> Freeze for SseResponse<S>where
S: Freeze,
impl<S> RefUnwindSafe for SseResponse<S>where
S: RefUnwindSafe,
impl<S> Send for SseResponse<S>where
S: Send,
impl<S> Sync for SseResponse<S>where
S: Sync,
impl<S> Unpin for SseResponse<S>where
S: Unpin,
impl<S> UnwindSafe for SseResponse<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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).