pub trait Source: Send + Sync {
// Required methods
fn kind(&self) -> &str;
fn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Event>, BlockError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A producer of Events.
ST3 uses push-style ingress (mpsc::Sender<Event> cloned into each
adapter) and does not exercise this trait. Retained for ST4+ adapters
that prefer a pull interface.
Required Methods§
Sourcefn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Event>, BlockError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Event>, BlockError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Pull the next event. Ok(None) signals the source has been
exhausted and will produce no more events. Err is logged by the
dispatcher (or the caller) and does not terminate the bus.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".