pub struct RefStore { /* private fields */ }Expand description
File-backed ref-state and ref-log store.
Implementations§
Source§impl RefStore
impl RefStore
Sourcepub fn new(layout: RepositoryLayout) -> Self
pub fn new(layout: RepositoryLayout) -> Self
Create a ref store for a repository layout.
Sourcepub fn layout(&self) -> &RepositoryLayout
pub fn layout(&self) -> &RepositoryLayout
Return the repository layout.
Sourcepub fn publish(&self, publication: &RefPublication) -> Result<ObjectId>
pub fn publish(&self, publication: &RefPublication) -> Result<ObjectId>
Publish a signed RefState with ref-specific locking and CAS. Writes through a freshly
decoded FileObjectStore – the safe default for any caller not holding its own session. See
Self::publish_with_object_store for a caller that already has one (RFC 111 §6.1 Stage 2).
Sourcepub fn publish_with_object_store(
&self,
object_store: &mut impl ObjectWriter,
publication: &RefPublication,
) -> Result<ObjectId>
pub fn publish_with_object_store( &self, object_store: &mut impl ObjectWriter, publication: &RefPublication, ) -> Result<ObjectId>
Same as Self::publish, but writes the RefState through the caller’s own object store
instead of constructing a fresh one – required for any caller holding an ObjectWriteSession
(RFC 111 §6.1 Stage 2 addendum, C1: this is the nested-writer site that must be threaded at or
before the first writer migration, not after).
Sourcepub fn finish_interrupted_publication(
&self,
active_lock: &ActiveLock,
publication: &RefPublication,
) -> Result<ObjectId>
pub fn finish_interrupted_publication( &self, active_lock: &ActiveLock, publication: &RefPublication, ) -> Result<ObjectId>
Finish an exact signer-backed interrupted publication, including a framing-incomplete tail.
Writes through a freshly decoded FileObjectStore – see
Self::finish_interrupted_publication_with_object_store for a caller that already has one.
Sourcepub fn finish_interrupted_publication_with_object_store(
&self,
object_store: &mut impl ObjectWriter,
active_lock: &ActiveLock,
publication: &RefPublication,
) -> Result<ObjectId>
pub fn finish_interrupted_publication_with_object_store( &self, object_store: &mut impl ObjectWriter, active_lock: &ActiveLock, publication: &RefPublication, ) -> Result<ObjectId>
Same as Self::finish_interrupted_publication, but writes the RefState through the
caller’s own object store instead of constructing a fresh one (RFC 111 §6.1 Stage 2 addendum,
C1).
Sourcepub fn read_current_ref_state_id(
&self,
ref_name: &str,
) -> Result<Option<ObjectId>>
pub fn read_current_ref_state_id( &self, ref_name: &str, ) -> Result<Option<ObjectId>>
Read the current RefState object ID for a ref name.
Sourcepub fn replay_log(&self, ref_name: &str) -> Result<RefLogReplay>
pub fn replay_log(&self, ref_name: &str) -> Result<RefLogReplay>
Replay the inline ref-update log for a ref name.
Sourcepub fn list_ref_pointers(&self) -> Result<Vec<RefPointerSummary>>
pub fn list_ref_pointers(&self) -> Result<Vec<RefPointerSummary>>
Enumerate every published ref pointer, sorted by name. Reads the ref-pointer index’s own
last-entry-per-ref_name_key view (RFC 102 Stage 4) – the container-era equivalent of the
old by-id/ directory listing, which named the complete set of ref pointers directly; the
index now does.
Sourcepub fn recoverable_missing_ref(
&self,
ref_name: &str,
) -> Result<Option<RefRecoveryCandidate>>
pub fn recoverable_missing_ref( &self, ref_name: &str, ) -> Result<Option<RefRecoveryCandidate>>
Return a diagnostic candidate when the pointer is missing but the format-1 log is valid.