pub struct Repository { /* private fields */ }Expand description
A read-only segment store repository.
Implementations§
Source§impl Repository
impl Repository
Sourcepub fn open_with_progress(
directory: &Path,
observer: &mut dyn ProgressObserver,
) -> Result<Self>
pub fn open_with_progress( directory: &Path, observer: &mut dyn ProgressObserver, ) -> Result<Self>
Opens the segment store in directory read-only, reporting the
archive scan — the part that takes real time on a large store — to
observer.
Sourcepub fn archives(&self) -> &[TarArchiveReader]
pub fn archives(&self) -> &[TarArchiveReader]
The open archives, newest archive number first.
Sourcepub fn journal_entries(&self) -> &[JournalEntry]
pub fn journal_entries(&self) -> &[JournalEntry]
The journal entries, newest first.
Sourcepub fn head_record_identifier(&self) -> RecordIdentifier
pub fn head_record_identifier(&self) -> RecordIdentifier
The record identifier of the current head (the super-root node).
Sourcepub fn segment_count(&self) -> usize
pub fn segment_count(&self) -> usize
The number of segments across all archives (duplicates counted once).
Sourcepub fn contains_segment(&self, segment_identifier: SegmentIdentifier) -> bool
pub fn contains_segment(&self, segment_identifier: SegmentIdentifier) -> bool
Whether any archive contains the given segment.
Sourcepub fn segment_identifiers(
&self,
) -> impl Iterator<Item = SegmentIdentifier> + '_
pub fn segment_identifiers( &self, ) -> impl Iterator<Item = SegmentIdentifier> + '_
All segment identifiers, in archive probe order. A segment served by two archives is yielded once per archive.
Sourcepub fn distinct_segment_identifiers(
&self,
) -> impl Iterator<Item = SegmentIdentifier> + '_
pub fn distinct_segment_identifiers( &self, ) -> impl Iterator<Item = SegmentIdentifier> + '_
Every segment identifier exactly once, in archive probe order.
A store-wide scan that must not process a segment twice uses this rather than accumulating its own seen-set: the location map that settles duplicates is already built, so the deduplication is free where the caller’s would have been one entry per segment.
Sourcepub fn segment_bytes(
&self,
segment_identifier: SegmentIdentifier,
) -> Result<&[u8]>
pub fn segment_bytes( &self, segment_identifier: SegmentIdentifier, ) -> Result<&[u8]>
Returns the exact stored bytes of a segment from the active archive selection without parsing its header or record tables.
This is the read-only escape hatch used by last-resort diagnostics:
callers can still inspect a segment whose structure is corrupt enough
that SegmentProvider::segment cannot construct a SegmentView.
Sourcepub fn node(&self, record_identifier: RecordIdentifier) -> NodeState<'_>
pub fn node(&self, record_identifier: RecordIdentifier) -> NodeState<'_>
The node state at an arbitrary node record.
Sourcepub fn head(&self) -> NodeState<'_>
pub fn head(&self) -> NodeState<'_>
The head node state: the super-root, whose children are root
(the content tree) and, when checkpoints exist, checkpoints.
Sourcepub fn content_root(&self) -> Result<NodeState<'_>>
pub fn content_root(&self) -> Result<NodeState<'_>>
The content root — the node JCR paths are relative to.
Trait Implementations§
Source§impl Debug for Repository
impl Debug for Repository
Source§impl SegmentProvider for Repository
impl SegmentProvider for Repository
Source§fn segment(
&self,
segment_identifier: SegmentIdentifier,
) -> Result<SegmentView<'_>>
fn segment( &self, segment_identifier: SegmentIdentifier, ) -> Result<SegmentView<'_>>
Error::SegmentNotFound
when no archive of the repository contains it.