pub trait BlockListener: Send + Sync {
// Required methods
fn chain_slug(&self) -> &str;
fn subscribe<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RawEventStream, StreamError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn is_connected(&self) -> bool;
}Expand description
Abstracts over different chain RPC backends.
Required Methods§
Sourcefn chain_slug(&self) -> &str
fn chain_slug(&self) -> &str
Chain slug this listener covers.
Sourcefn subscribe<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RawEventStream, StreamError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RawEventStream, StreamError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connect and start streaming raw events.
Returns a pinned async stream of RawEvent items.
Sourcefn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Returns true if this listener is currently connected.