pub struct Sse<S> { /* private fields */ }
Expand description
An SSE response
Implementations
sourceimpl<S> Sse<S>
impl<S> Sse<S>
sourcepub fn new(stream: S) -> Self where
S: TryStream<Ok = Event> + Send + 'static,
S::Error: Into<BoxError>,
pub fn new(stream: S) -> Self where
S: TryStream<Ok = Event> + Send + 'static,
S::Error: Into<BoxError>,
Create a new Sse
response that will respond with the given stream of
Event
s.
See the module docs for more details.
sourcepub fn keep_alive(self, keep_alive: KeepAlive) -> Self
pub fn keep_alive(self, keep_alive: KeepAlive) -> Self
Configure the interval between keep-alive messages.
Defaults to no keep-alive messages.
Trait Implementations
Auto Trait Implementations
impl<S> RefUnwindSafe for Sse<S> where
S: RefUnwindSafe,
impl<S> Send for Sse<S> where
S: Send,
impl<S> Sync for Sse<S> where
S: Sync,
impl<S> Unpin for Sse<S> where
S: Unpin,
impl<S> UnwindSafe for Sse<S> where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more