Skip to main content

Source

Trait Source 

Source
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§

Source

fn kind(&self) -> &str

Canonical kind string used by this source (e.g. "mesh").

Source

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

Implementors§