Skip to main content

RefStore

Struct RefStore 

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

File-backed ref-state and ref-log store.

Implementations§

Source§

impl RefStore

Source

pub fn new(layout: RepositoryLayout) -> Self

Create a ref store for a repository layout.

Source

pub fn layout(&self) -> &RepositoryLayout

Return the repository layout.

Source

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).

Source

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).

Source

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.

Source

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).

Source

pub fn read_current_ref_state_id( &self, ref_name: &str, ) -> Result<Option<ObjectId>>

Read the current RefState object ID for a ref name.

Source

pub fn replay_log(&self, ref_name: &str) -> Result<RefLogReplay>

Replay the inline ref-update log for a ref name.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for RefStore

Source§

fn clone(&self) -> RefStore

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RefStore

Source§

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

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.