diff --git a/src/data_source/extension.rs b/src/data_source/extension.rs index 6831930c..7477f0ed 100644 --- a/src/data_source/extension.rs +++ b/src/data_source/extension.rs @@ -119,11 +119,13 @@ where D: VersionedDataSource + Send, U: Send + Sync, { - type Transaction<'a> = D::Transaction<'a> + type Transaction<'a> + = D::Transaction<'a> where Self: 'a; - type ReadOnly<'a> = D::ReadOnly<'a> + type ReadOnly<'a> + = D::ReadOnly<'a> where Self: 'a; @@ -144,22 +146,28 @@ where Types: NodeType, Payload: QueryablePayload, { - type LeafRange = D::LeafRange + type LeafRange + = D::LeafRange where R: RangeBounds + Send; - type BlockRange = D::BlockRange + type BlockRange + = D::BlockRange where R: RangeBounds + Send; - type PayloadRange = D::PayloadRange + type PayloadRange + = D::PayloadRange where R: RangeBounds + Send; - type PayloadMetadataRange = D::PayloadMetadataRange + type PayloadMetadataRange + = D::PayloadMetadataRange where R: RangeBounds + Send; - type VidCommonRange = D::VidCommonRange + type VidCommonRange + = D::VidCommonRange where R: RangeBounds + Send; - type VidCommonMetadataRange = D::VidCommonMetadataRange + type VidCommonMetadataRange + = D::VidCommonMetadataRange where R: RangeBounds + Send; diff --git a/src/data_source/fetching.rs b/src/data_source/fetching.rs index 61deed94..715f96bd 100644 --- a/src/data_source/fetching.rs +++ b/src/data_source/fetching.rs @@ -559,22 +559,28 @@ where for<'a> S::ReadOnly<'a>: AvailabilityStorage + NodeStorage + PrunedHeightStorage, P: AvailabilityProvider, { - type LeafRange = BoxStream<'static, Fetch>> + type LeafRange + = BoxStream<'static, Fetch>> where R: RangeBounds + Send; - type BlockRange = BoxStream<'static, Fetch>> + type BlockRange + = BoxStream<'static, Fetch>> where R: RangeBounds + Send; - type PayloadRange = BoxStream<'static, Fetch>> + type PayloadRange + = BoxStream<'static, Fetch>> where R: RangeBounds + Send; - type PayloadMetadataRange = BoxStream<'static, Fetch>> + type PayloadMetadataRange + = BoxStream<'static, Fetch>> where R: RangeBounds + Send; - type VidCommonRange = BoxStream<'static, Fetch>> + type VidCommonRange + = BoxStream<'static, Fetch>> where R: RangeBounds + Send; - type VidCommonMetadataRange = BoxStream<'static, Fetch>> + type VidCommonMetadataRange + = BoxStream<'static, Fetch>> where R: RangeBounds + Send; @@ -714,10 +720,12 @@ where S: VersionedDataSource + Send + Sync, P: Send + Sync, { - type Transaction<'a> = S::Transaction<'a> + type Transaction<'a> + = S::Transaction<'a> where Self: 'a; - type ReadOnly<'a> = S::ReadOnly<'a> + type ReadOnly<'a> + = S::ReadOnly<'a> where Self: 'a; @@ -760,10 +768,12 @@ where S: VersionedDataSource + Send + Sync, P: Send + Sync, { - type Transaction<'a> = S::Transaction<'a> + type Transaction<'a> + = S::Transaction<'a> where Self: 'a; - type ReadOnly<'a> = S::ReadOnly<'a> + type ReadOnly<'a> + = S::ReadOnly<'a> where Self: 'a; diff --git a/src/data_source/storage/fail_storage.rs b/src/data_source/storage/fail_storage.rs index c52010c7..3a9cae47 100644 --- a/src/data_source/storage/fail_storage.rs +++ b/src/data_source/storage/fail_storage.rs @@ -205,10 +205,12 @@ impl VersionedDataSource for FailStorage where S: VersionedDataSource, { - type Transaction<'a> = Transaction> + type Transaction<'a> + = Transaction> where Self: 'a; - type ReadOnly<'a> = Transaction> + type ReadOnly<'a> + = Transaction> where Self: 'a; diff --git a/src/data_source/storage/fs.rs b/src/data_source/storage/fs.rs index bfb1122d..bf66b84a 100644 --- a/src/data_source/storage/fs.rs +++ b/src/data_source/storage/fs.rs @@ -357,10 +357,12 @@ impl VersionedDataSource for FileSystemStorage where Payload: QueryablePayload, { - type Transaction<'a> = Transaction>> + type Transaction<'a> + = Transaction>> where Self: 'a; - type ReadOnly<'a> = Transaction>> + type ReadOnly<'a> + = Transaction>> where Self: 'a; diff --git a/src/data_source/storage/no_storage.rs b/src/data_source/storage/no_storage.rs index 3f67055d..841f4366 100644 --- a/src/data_source/storage/no_storage.rs +++ b/src/data_source/storage/no_storage.rs @@ -56,10 +56,12 @@ pub struct Transaction<'a> { } impl VersionedDataSource for NoStorage { - type Transaction<'a> = Transaction<'a> + type Transaction<'a> + = Transaction<'a> where Self: 'a; - type ReadOnly<'a> = Transaction<'a> + type ReadOnly<'a> + = Transaction<'a> where Self: 'a; @@ -457,10 +459,12 @@ pub mod testing { // Now a lot of boilerplate to implement all teh traits for [`DataSource`], by dispatching each // method to either variant. impl VersionedDataSource for DataSource { - type Transaction<'a> = Transaction<'a, ::Transaction<'a>> + type Transaction<'a> + = Transaction<'a, ::Transaction<'a>> where Self: 'a; - type ReadOnly<'a> = Transaction<'a, ::ReadOnly<'a>> + type ReadOnly<'a> + = Transaction<'a, ::ReadOnly<'a>> where Self: 'a; @@ -549,22 +553,28 @@ pub mod testing { #[async_trait] impl AvailabilityDataSource for DataSource { - type LeafRange = BoxStream<'static, Fetch>> + type LeafRange + = BoxStream<'static, Fetch>> where R: RangeBounds + Send; - type BlockRange = BoxStream<'static, Fetch>> + type BlockRange + = BoxStream<'static, Fetch>> where R: RangeBounds + Send; - type PayloadRange = BoxStream<'static, Fetch>> + type PayloadRange + = BoxStream<'static, Fetch>> where R: RangeBounds + Send; - type PayloadMetadataRange = BoxStream<'static, Fetch>> + type PayloadMetadataRange + = BoxStream<'static, Fetch>> where R: RangeBounds + Send; - type VidCommonRange = BoxStream<'static, Fetch>> + type VidCommonRange + = BoxStream<'static, Fetch>> where R: RangeBounds + Send; - type VidCommonMetadataRange = BoxStream<'static, Fetch>> + type VidCommonMetadataRange + = BoxStream<'static, Fetch>> where R: RangeBounds + Send; diff --git a/src/data_source/storage/sql.rs b/src/data_source/storage/sql.rs index 07941fc0..06c8902f 100644 --- a/src/data_source/storage/sql.rs +++ b/src/data_source/storage/sql.rs @@ -653,10 +653,12 @@ impl PruneStorage for SqlStorage { } impl VersionedDataSource for SqlStorage { - type Transaction<'a> = Transaction + type Transaction<'a> + = Transaction where Self: 'a; - type ReadOnly<'a> = Transaction + type ReadOnly<'a> + = Transaction where Self: 'a; diff --git a/src/lib.rs b/src/lib.rs index 7bf465fc..e77ab5a9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -627,40 +627,28 @@ mod test { #[async_trait] impl AvailabilityDataSource for CompositeState { - type LeafRange = - >::LeafRange + type LeafRange + = >::LeafRange where R: RangeBounds + Send; - type BlockRange = - >::BlockRange + type BlockRange + = >::BlockRange where R: RangeBounds + Send; - type PayloadRange = - >::PayloadRange + type PayloadRange + = >::PayloadRange where R: RangeBounds + Send; - type PayloadMetadataRange = - >::PayloadMetadataRange + type PayloadMetadataRange + = >::PayloadMetadataRange where R: RangeBounds + Send; - type VidCommonRange = - >::VidCommonRange + type VidCommonRange + = >::VidCommonRange where R: RangeBounds + Send; - type VidCommonMetadataRange = - >::VidCommonMetadataRange + type VidCommonMetadataRange + = >::VidCommonMetadataRange where R: RangeBounds + Send;