Skip to main content

EventStream

Trait EventStream 

Source
pub trait EventStream: Send {
    // Required method
    fn next_event<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Option<Value>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

A streaming event source. The server polls next_event until the client disconnects or the stream returns None.

Required Methods§

Source

fn next_event<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Option<Value>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Some(event) = next event payload to write as Event { event }. None = stream terminated normally; the server writes End.

Implementors§