Struct Sse

#[must_use]
pub struct Sse<S> { /* private fields */ }

An SSE response

Implementations

impl<S> Sse<S>

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 Events.

See the module docs for more details.

fn keep_alive(self, keep_alive: KeepAlive) -> Sse<KeepAliveStream<S>>

Configure the interval between keep-alive messages.

Defaults to no keep-alive messages.

Trait Implementations

impl<S> Debug for Sse<S>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<S, E> IntoResponse for Sse<S> where S: Stream<Item = Result<Event, E>> + Send + 'static, E: Into<BoxError>,

fn into_response(self) -> Response

impl<S: Clone> Clone for Sse<S>

fn clone(&self) -> Self

Auto Trait Implementations

impl<S> Freeze for Sse<S> where S: Freeze,

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> UnsafeUnpin for Sse<S> where S: UnsafeUnpin,

impl<S> UnwindSafe for Sse<S> where S: UnwindSafe,

Blanket Implementations

impl<H, T> HandlerWithoutStateExt<T> for Sse<S> where H: Handler<T, ()>,

fn into_service(self) -> HandlerService<H, T, ()>
fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, ()>>
fn into_make_service_with_connect_info<C>(self) -> IntoMakeServiceWithConnectInfo<HandlerService<H, T, ()>, C>

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for Sse<S> where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for Sse<S> where ST: ?Sized, DT: ?Sized,

impl<T> Any for Sse<S> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Sse<S> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Sse<S> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for Sse<S> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for Sse<S>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> FromRef<T> for Sse<S> where T: Clone,

fn from_ref(input: &T) -> T

impl<T> Instrument for Sse<S>

impl<T> Read<Exclusive, BecauseExclusive> for Sse<S> where T: ?Sized,

impl<T> Same for Sse<S>

type Output = T;

impl<T> ToOwned for Sse<S> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> WithSubscriber for Sse<S>

impl<T, U> Into<U> for Sse<S> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Sse<S> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Sse<S> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

impl<V, T> VZip<V> for Sse<S> where V: MultiLane<T>,

fn vzip(self) -> V