Skip to main content

Repository

Struct Repository 

Source
pub struct Repository { /* private fields */ }
Expand description

A read-only segment store repository.

Implementations§

Source§

impl Repository

Source

pub fn open(directory: &Path) -> Result<Self>

Opens the segment store in directory read-only.

Source

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.

Source

pub fn directory(&self) -> &Path

The directory this repository was opened from.

Source

pub fn archives(&self) -> &[TarArchiveReader]

The open archives, newest archive number first.

Source

pub fn journal_entries(&self) -> &[JournalEntry]

The journal entries, newest first.

Source

pub fn head_record_identifier(&self) -> RecordIdentifier

The record identifier of the current head (the super-root node).

Source

pub fn segment_count(&self) -> usize

The number of segments across all archives (duplicates counted once).

Source

pub fn contains_segment(&self, segment_identifier: SegmentIdentifier) -> bool

Whether any archive contains the given segment.

Source

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.

Source

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.

Source

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.

Source

pub fn node(&self, record_identifier: RecordIdentifier) -> NodeState<'_>

The node state at an arbitrary node record.

Source

pub fn head(&self) -> NodeState<'_>

The head node state: the super-root, whose children are root (the content tree) and, when checkpoints exist, checkpoints.

Source

pub fn content_root(&self) -> Result<NodeState<'_>>

The content root — the node JCR paths are relative to.

Source

pub fn node_at_path(&self, path: &str) -> Result<Option<NodeState<'_>>>

Resolves a content path such as /content/dam from the content root. / resolves to the content root itself.

Source

pub fn checkpoints(&self) -> Result<Vec<(String, NodeState<'_>)>>

The repository’s checkpoints as (name, checkpoint node) pairs. Each checkpoint node has created and timestamp properties, a properties child with caller-supplied metadata, and a root child holding the content snapshot.

Trait Implementations§

Source§

impl Debug for Repository

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl SegmentProvider for Repository

Source§

fn segment( &self, segment_identifier: SegmentIdentifier, ) -> Result<SegmentView<'_>>

Returns the given segment, or Error::SegmentNotFound when no archive of the repository contains it.
Source§

fn string(&self, record_identifier: RecordIdentifier) -> Result<Arc<str>>

Reads the string value record at record_identifier, possibly from a cache.
Source§

fn template(&self, record_identifier: RecordIdentifier) -> Result<Arc<Template>>

Reads the template record at record_identifier, possibly from a cache.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.