global: snapshot

This commit is contained in:
nym21
2025-11-10 13:18:41 +01:00
parent f6a2a0540b
commit 37f5f50867
50 changed files with 1550 additions and 334 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ impl Vecs {
};
this.db.retain_regions(
this.iter_any_collectable()
this.iter_any_writable()
.flat_map(|v| v.region_names())
.collect(),
)?;
+1 -1
View File
@@ -1097,7 +1097,7 @@ impl Vecs {
};
this.db.retain_regions(
this.iter_any_collectable()
this.iter_any_writable()
.flat_map(|v| v.region_names())
.collect(),
)?;
+1 -1
View File
@@ -279,7 +279,7 @@ impl Vecs {
};
this.db.retain_regions(
this.iter_any_collectable()
this.iter_any_writable()
.flat_map(|v| v.region_names())
.collect(),
)?;
+1 -1
View File
@@ -162,7 +162,7 @@ impl Vecs {
};
this.db.retain_regions(
this.iter_any_collectable()
this.iter_any_writable()
.flat_map(|v| v.region_names())
.collect(),
)?;
+1 -1
View File
@@ -44,7 +44,7 @@ impl Vecs {
};
this.db.retain_regions(
this.iter_any_collectable()
this.iter_any_writable()
.flat_map(|v| v.region_names())
.collect(),
)?;
@@ -534,7 +534,7 @@ where
pub fn starting_index(&self, max_from: I) -> I {
max_from.min(I::from(
self.iter_any_collectable().map(|v| v.len()).min().unwrap(),
self.iter_any_writable().map(|v| v.len()).min().unwrap(),
))
}
@@ -209,7 +209,7 @@ where
pub fn starting_index(&self, max_from: I) -> I {
max_from.min(I::from(
self.iter_any_collectable().map(|v| v.len()).min().unwrap(),
self.iter_any_writable().map(|v| v.len()).min().unwrap(),
))
}
@@ -4,7 +4,7 @@ use brk_traversable::Traversable;
use brk_types::{
DateIndex, DecadeIndex, MonthIndex, QuarterIndex, SemesterIndex, Version, WeekIndex, YearIndex,
};
use vecdb::{AnyCollectableVec, Database, EagerVec, Exit, IterableCloneableVec, IterableVec};
use vecdb::{AnyWritableVec, Database, EagerVec, Exit, IterableCloneableVec, IterableVec};
use crate::{Indexes, grouped::LazyVecsBuilder, indexes};
@@ -178,17 +178,17 @@ where
.unwrap()
}
fn iter_any_collectable(&self) -> impl Iterator<Item = &dyn AnyCollectableVec> {
let mut regular_iter: Box<dyn Iterator<Item = &dyn AnyCollectableVec>> =
Box::new(self.dateindex_extra.iter_any_collectable());
regular_iter = Box::new(regular_iter.chain(self.weekindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.monthindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.quarterindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.semesterindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.yearindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.decadeindex.iter_any_collectable()));
fn iter_any_writable(&self) -> impl Iterator<Item = &dyn AnyWritableVec> {
let mut regular_iter: Box<dyn Iterator<Item = &dyn AnyWritableVec>> =
Box::new(self.dateindex_extra.iter_any_writable());
regular_iter = Box::new(regular_iter.chain(self.weekindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.monthindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.quarterindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.semesterindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.yearindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.decadeindex.iter_any_writable()));
if let Some(ref x) = self.dateindex {
regular_iter = Box::new(regular_iter.chain(x.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(x.iter_any_writable()));
}
regular_iter
}
+13 -13
View File
@@ -5,7 +5,7 @@ use brk_types::{
DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, SemesterIndex,
Version, WeekIndex, YearIndex,
};
use vecdb::{AnyCollectableVec, Database, EagerVec, Exit, IterableCloneableVec, IterableVec};
use vecdb::{AnyWritableVec, Database, EagerVec, Exit, IterableCloneableVec, IterableVec};
use crate::{
Indexes,
@@ -239,19 +239,19 @@ where
.unwrap()
}
fn iter_any_collectable(&self) -> impl Iterator<Item = &dyn AnyCollectableVec> {
let mut regular_iter: Box<dyn Iterator<Item = &dyn AnyCollectableVec>> =
Box::new(self.height_extra.iter_any_collectable());
regular_iter = Box::new(regular_iter.chain(self.dateindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.weekindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.difficultyepoch.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.monthindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.quarterindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.semesterindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.yearindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.decadeindex.iter_any_collectable()));
fn iter_any_writable(&self) -> impl Iterator<Item = &dyn AnyWritableVec> {
let mut regular_iter: Box<dyn Iterator<Item = &dyn AnyWritableVec>> =
Box::new(self.height_extra.iter_any_writable());
regular_iter = Box::new(regular_iter.chain(self.dateindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.weekindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.difficultyepoch.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.monthindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.quarterindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.semesterindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.yearindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.decadeindex.iter_any_writable()));
if let Some(ref x) = self.height {
regular_iter = Box::new(regular_iter.chain(x.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(x.iter_any_writable()));
}
regular_iter
}
@@ -2,7 +2,7 @@ use brk_error::Result;
use brk_traversable::Traversable;
use brk_types::{DifficultyEpoch, Height, Version};
use vecdb::{AnyCollectableVec, Database, EagerVec, Exit};
use vecdb::{AnyWritableVec, Database, EagerVec, Exit};
use crate::{Indexes, indexes};
@@ -110,11 +110,11 @@ where
.merge_branches()
.unwrap()
}
fn iter_any_collectable(&self) -> impl Iterator<Item = &dyn AnyCollectableVec> {
let mut regular_iter: Box<dyn Iterator<Item = &dyn AnyCollectableVec>> =
Box::new(self.height.iter_any_collectable());
regular_iter = Box::new(regular_iter.chain(self.height_extra.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.difficultyepoch.iter_any_collectable()));
fn iter_any_writable(&self) -> impl Iterator<Item = &dyn AnyWritableVec> {
let mut regular_iter: Box<dyn Iterator<Item = &dyn AnyWritableVec>> =
Box::new(self.height.iter_any_writable());
regular_iter = Box::new(regular_iter.chain(self.height_extra.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.difficultyepoch.iter_any_writable()));
regular_iter
}
}
+13 -13
View File
@@ -6,7 +6,7 @@ use brk_types::{
Sats, SemesterIndex, TxIndex, Version, WeekIndex, YearIndex,
};
use vecdb::{
AnyCollectableVec, AnyVec, CollectableVec, Database, EagerVec, Exit, GenericStoredVec,
AnyVec, AnyWritableVec, CollectableVec, Database, EagerVec, Exit, GenericStoredVec,
IterableCloneableVec, StoredIndex, TypedVecIterator,
};
@@ -521,19 +521,19 @@ where
.unwrap()
}
fn iter_any_collectable(&self) -> impl Iterator<Item = &dyn AnyCollectableVec> {
let mut regular_iter: Box<dyn Iterator<Item = &dyn AnyCollectableVec>> =
Box::new(self.height.iter_any_collectable());
regular_iter = Box::new(regular_iter.chain(self.dateindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.weekindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.difficultyepoch.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.monthindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.quarterindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.semesterindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.yearindex.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(self.decadeindex.iter_any_collectable()));
fn iter_any_writable(&self) -> impl Iterator<Item = &dyn AnyWritableVec> {
let mut regular_iter: Box<dyn Iterator<Item = &dyn AnyWritableVec>> =
Box::new(self.height.iter_any_writable());
regular_iter = Box::new(regular_iter.chain(self.dateindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.weekindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.difficultyepoch.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.monthindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.quarterindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.semesterindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.yearindex.iter_any_writable()));
regular_iter = Box::new(regular_iter.chain(self.decadeindex.iter_any_writable()));
if let Some(ref x) = self.txindex {
regular_iter = Box::new(regular_iter.chain(x.iter_any_collectable()));
regular_iter = Box::new(regular_iter.chain(x.iter_any_writable()));
}
regular_iter
}
+1 -1
View File
@@ -492,7 +492,7 @@ impl Vecs {
};
this.db.retain_regions(
this.iter_any_collectable()
this.iter_any_writable()
.flat_map(|v| v.region_names())
.collect(),
)?;
+1 -1
View File
@@ -1517,7 +1517,7 @@ impl Vecs {
};
this.db.retain_regions(
this.iter_any_collectable()
this.iter_any_writable()
.flat_map(|v| v.region_names())
.collect(),
)?;
+1 -1
View File
@@ -62,7 +62,7 @@ impl Vecs {
};
this.db.retain_regions(
this.iter_any_collectable()
this.iter_any_writable()
.flat_map(|v| v.region_names())
.collect(),
)?;
+1 -1
View File
@@ -327,7 +327,7 @@ impl Vecs {
};
this.db.retain_regions(
this.iter_any_collectable()
this.iter_any_writable()
.flat_map(|v| v.region_names())
.collect(),
)?;
+1 -1
View File
@@ -482,7 +482,7 @@ impl Vecs {
};
this.db.retain_regions(
this.iter_any_collectable()
this.iter_any_writable()
.flat_map(|v| v.region_names())
.collect(),
)?;