NodeDataSource

Trait NodeDataSource 

Source
pub trait NodeDataSource<Types>
where Types: NodeType, Header<Types>: QueryableHeader<Types>,
{ // Required methods fn block_height<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn count_transactions_in_range<'life0, 'async_trait>( &'life0 self, range: impl 'async_trait + RangeBounds<usize> + Send, namespace: Option<NamespaceId<Types>>, ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn payload_size_in_range<'life0, 'async_trait>( &'life0 self, range: impl 'async_trait + RangeBounds<usize> + Send, namespace: Option<NamespaceId<Types>>, ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn vid_share<'life0, 'async_trait, ID>( &'life0 self, id: ID, ) -> Pin<Box<dyn Future<Output = QueryResult<VidShare>> + Send + 'async_trait>> where ID: Into<BlockId<Types>> + Send + Sync + 'async_trait, Self: 'async_trait, 'life0: 'async_trait; fn get_header_window<'life0, 'async_trait>( &'life0 self, start: impl 'async_trait + Into<WindowStart<Types>> + Send + Sync, end: u64, limit: usize, ) -> Pin<Box<dyn Future<Output = QueryResult<TimeWindowQueryData<Header<Types>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn sync_status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = QueryResult<SyncStatusQueryData>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn count_transactions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn payload_size<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } }

Required Methods§

Source

fn block_height<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn count_transactions_in_range<'life0, 'async_trait>( &'life0 self, range: impl 'async_trait + RangeBounds<usize> + Send, namespace: Option<NamespaceId<Types>>, ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn payload_size_in_range<'life0, 'async_trait>( &'life0 self, range: impl 'async_trait + RangeBounds<usize> + Send, namespace: Option<NamespaceId<Types>>, ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn vid_share<'life0, 'async_trait, ID>( &'life0 self, id: ID, ) -> Pin<Box<dyn Future<Output = QueryResult<VidShare>> + Send + 'async_trait>>
where ID: Into<BlockId<Types>> + Send + Sync + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_header_window<'life0, 'async_trait>( &'life0 self, start: impl 'async_trait + Into<WindowStart<Types>> + Send + Sync, end: u64, limit: usize, ) -> Pin<Box<dyn Future<Output = QueryResult<TimeWindowQueryData<Header<Types>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn sync_status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = QueryResult<SyncStatusQueryData>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Search the database for missing objects and generate a report.

§Consistency

Each SyncStatusRange in the response accurately describes the status of that range of objects at a recent point in time. (It is of course impossible to consistently describe the status of the range now, as this method does not require any lock to call, and thus the sync status could change immediately after being checked.)

It is not practical to scan the entire database for missing objects in a single atomic transaction. Thus, it is possible that different ranges in the response reflect the state of that portion of the database at different times. In other words, each range is an atomic snapshot of a subset of the database, but there may never have been a time when the entire database had the exact state represented by the collection of ranges in response, all at once.

Provided Methods§

Source

fn count_transactions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn payload_size<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

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.

Implementors§

Source§

impl<D, U, Types> NodeDataSource<Types> for ExtensibleDataSource<D, U>
where D: NodeDataSource<Types> + Send + Sync, U: Send + Sync, Types: NodeType, Header<Types>: QueryableHeader<Types>,

Source§

impl<Types, S, P> NodeDataSource<Types> for FetchingDataSource<Types, S, P>
where Types: NodeType, Header<Types>: QueryableHeader<Types>, S: VersionedDataSource + 'static, for<'a> S::ReadOnly<'a>: NodeStorage<Types> + PrunedHeightStorage, P: Send + Sync,