global: snapshot

This commit is contained in:
nym21
2025-04-27 16:29:21 +02:00
parent 1e38c21f8e
commit 9ae0a57f22
22 changed files with 1643 additions and 555 deletions

View File

@@ -45,7 +45,7 @@ pub trait DynamicVec: Send + Sync {
.map(Value::Owned))
}
fn get_stored_(&self, index: usize, mmap: &Mmap) -> Result<Option<Self::T>>;
fn get_last(&self) -> Result<Option<Value<Self::T>>> {
fn last(&self) -> Result<Option<Value<Self::T>>> {
let len = self.len();
if len == 0 {
return Ok(None);

View File

@@ -98,30 +98,6 @@ where
Self::I::to_string()
}
#[inline]
fn iter<F>(&mut self, f: F) -> Result<()>
where
F: FnMut(
(
Self::I,
Self::T,
&mut dyn DynamicVec<I = Self::I, T = Self::T>,
),
) -> Result<()>,
{
self.iter_from(Self::I::default(), f)
}
fn iter_from<F>(&mut self, index: Self::I, f: F) -> Result<()>
where
F: FnMut(
(
Self::I,
Self::T,
&mut dyn DynamicVec<I = Self::I, T = Self::T>,
),
) -> Result<()>;
fn flush(&mut self) -> Result<()>;
fn truncate_if_needed(&mut self, index: Self::I) -> Result<()>;