pub trait Subscription: Send + 'static {
// Required method
fn next_event(
&mut self,
) -> impl Future<Output = Option<StreamEvent>> + Send + '_;
}Expand description
Stream event subscription used by built-in consumers.
Required Methods§
Sourcefn next_event(
&mut self,
) -> impl Future<Output = Option<StreamEvent>> + Send + '_
fn next_event( &mut self, ) -> impl Future<Output = Option<StreamEvent>> + Send + '_
Returns the next stream event, or None once the subscription is closed.
None is only returned after the subscription has emitted a terminal event
(StreamEvent::Eof or StreamEvent::ReadError) on this subscription, after which it
will remain None for every subsequent call. Implementations must not return None while
further chunks or gap markers are still pending.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.