pub trait ChainDataSource: Send + Sync {
// Required methods
fn height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn query<'life0, 'async_trait>(
&'life0 self,
query: Query,
) -> Pin<Box<dyn Future<Output = Result<SourcePage, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn height_stream(&self) -> Option<ChainHeightStream> { ... }
}Expand description
Async boundary around HyperSync, mockable at the external service edge.
Required Methods§
Sourcefn height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return the current exclusive archive height.
Blocks with numbers strictly below this height are available to query.
§Errors
Returns SourceError when the external provider is unavailable,
rejects the request, times out, or cannot supply a usable height.
Sourcefn query<'life0, 'async_trait>(
&'life0 self,
query: Query,
) -> Pin<Box<dyn Future<Output = Result<SourcePage, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn query<'life0, 'async_trait>(
&'life0 self,
query: Query,
) -> Pin<Box<dyn Future<Output = Result<SourcePage, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute one bounded query page.
§Errors
Returns SourceError when the external provider/transport rejects,
times out, or cannot complete the query.
Provided Methods§
Sourcefn height_stream(&self) -> Option<ChainHeightStream>
fn height_stream(&self) -> Option<ChainHeightStream>
Subscribe to archive-height updates when the provider offers a push
channel. Returning None leaves the service on its polling fallback.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".