pub struct IndexedSnapshot { /* private fields */ }Expand description
A single-consumer bounded view of a valid native journal index graph.
Open while appends, rotation and truncation are excluded by the caller.
After capture, supported append-only writers may resume. In-place mutation
and truncation are unsupported. Uncertain files require verify_index first.
This API never falls back to a row scan for an indexed operation. .journal.zst
uses whole-file staging and therefore has full-file decompression opening cost.
Implementations§
Source§impl IndexedSnapshot
impl IndexedSnapshot
pub fn open( path: impl AsRef<Path>, options: IndexedSnapshotOptions, control: &SnapshotControl<'_>, ) -> Result<Self>
pub fn entry_count(&self) -> u64
Sourcepub fn is_archived(&self) -> bool
pub fn is_archived(&self) -> bool
Whether the captured header was archived. This remains fixed if the file is archived later; it does not certify index integrity.
pub fn captured_value(&self, name: &[u8], value: &[u8]) -> Result<CapturedValue>
pub fn visit_match( &mut self, name: &[u8], value: &[u8], control: &SnapshotControl<'_>, visit: impl FnMut(&mut SnapshotEntry<'_>) -> Result<()>, ) -> Result<()>
Sourcepub fn visit_field(
&mut self,
name: &[u8],
control: &SnapshotControl<'_>,
accept: impl FnMut(&[u8]) -> Result<bool>,
visit: impl FnMut(&mut SnapshotEntry<'_>) -> Result<()>,
) -> Result<()>
pub fn visit_field( &mut self, name: &[u8], control: &SnapshotControl<'_>, accept: impl FnMut(&[u8]) -> Result<bool>, visit: impl FnMut(&mut SnapshotEntry<'_>) -> Result<()>, ) -> Result<()>
Streams postings for every accepted value; multivalued rows may repeat. No union, deduplication, or sorting is performed.
Sourcepub fn visit_entries(
&mut self,
control: &SnapshotControl<'_>,
visit: impl FnMut(&mut SnapshotEntry<'_>) -> Result<()>,
) -> Result<()>
pub fn visit_entries( &mut self, control: &SnapshotControl<'_>, visit: impl FnMut(&mut SnapshotEntry<'_>) -> Result<()>, ) -> Result<()>
Lazily streams all captured entries, with O(entries) work and bounded chunks.