pub struct MemoryRefStore { /* private fields */ }Expand description
Fully in-memory ref database with transactional updates.
Built only on the public super::backend helpers, so it doubles as a reference for
custom backends. One prepared transaction at a time holds the whole store; another
prepare meanwhile fails with RefStoreError::LockHeld, which grit-lib’s ref writes
retry (see crate::refs::prepare_with_lock_wait).
Implementations§
Trait Implementations§
Source§impl Debug for MemoryRefStore
impl Debug for MemoryRefStore
Source§impl Default for MemoryRefStore
impl Default for MemoryRefStore
Source§impl RefStore for MemoryRefStore
impl RefStore for MemoryRefStore
Source§fn format(&self) -> RefStorageFormat
fn format(&self) -> RefStorageFormat
Which on-disk or logical format this store uses. Read more
Source§fn read_raw(&self, name: &str) -> Result<Option<RawRef>>
fn read_raw(&self, name: &str) -> Result<Option<RawRef>>
Read the stored value for
name without resolving symbolic targets. Read moreSource§fn for_each_ref(
&self,
prefix: &str,
f: &mut dyn FnMut(&RefEntry) -> ControlFlow<()>,
) -> Result<()>
fn for_each_ref( &self, prefix: &str, f: &mut dyn FnMut(&RefEntry) -> ControlFlow<()>, ) -> Result<()>
Source§fn prepare(
&self,
txn: RefTransaction,
) -> Result<Box<dyn PreparedRefTransaction + Send + '_>, RefStoreError>
fn prepare( &self, txn: RefTransaction, ) -> Result<Box<dyn PreparedRefTransaction + Send + '_>, RefStoreError>
Validate
txn, take locks, and return a committable batch. Read moreSource§fn for_each_reflog_entry(
&self,
name: &str,
reverse: bool,
f: &mut dyn FnMut(&ReflogEntry) -> ControlFlow<()>,
) -> Result<()>
fn for_each_reflog_entry( &self, name: &str, reverse: bool, f: &mut dyn FnMut(&ReflogEntry) -> ControlFlow<()>, ) -> Result<()>
Source§fn create_reflog(&self, name: &str) -> Result<()>
fn create_reflog(&self, name: &str) -> Result<()>
Create an empty reflog file/record for
name.Source§fn replace_reflog(&self, name: &str, entries: Vec<ReflogEntry>) -> Result<()>
fn replace_reflog(&self, name: &str, entries: Vec<ReflogEntry>) -> Result<()>
Replace the entire reflog (used by expire/delete-entries).
Source§fn rewrite_reflog(
&self,
name: &str,
transform: &mut dyn FnMut(Vec<ReflogEntry>) -> Result<Vec<ReflogEntry>>,
) -> Result<()>
fn rewrite_reflog( &self, name: &str, transform: &mut dyn FnMut(Vec<ReflogEntry>) -> Result<Vec<ReflogEntry>>, ) -> Result<()>
Read a reflog under the backend writer lock, transform it, and write it back atomically. Read more
Source§fn for_each_reflog_ref(
&self,
f: &mut dyn FnMut(&str) -> ControlFlow<()>,
) -> Result<()>
fn for_each_reflog_ref( &self, f: &mut dyn FnMut(&str) -> ControlFlow<()>, ) -> Result<()>
Invoke
f for each ref name that has a reflog, in sorted order. Read moreSource§fn resolve(&self, name: &str) -> Result<ObjectId>
fn resolve(&self, name: &str) -> Result<ObjectId>
Resolve
name to an object id, following symbolic refs. Read moreSource§fn for_each_physical_stack_ref(
&self,
prefix: &str,
f: &mut dyn FnMut(&RefEntry) -> ControlFlow<()>,
) -> Result<()>
fn for_each_physical_stack_ref( &self, prefix: &str, f: &mut dyn FnMut(&RefEntry) -> ControlFlow<()>, ) -> Result<()>
Walk refs stored in this handle’s physical reftable stack (
reftable/ under the
store git directory). On the files backend this matches Self::for_each_ref.Source§fn verify_update_targets(
&self,
updates: &[RefUpdate],
) -> Result<(), RefStoreError>
fn verify_update_targets( &self, updates: &[RefUpdate], ) -> Result<(), RefStoreError>
Check the objects
updates would point refs at, without taking any lock or writing. Read moreSource§fn as_files(&self) -> Option<&FilesRefStore>
fn as_files(&self) -> Option<&FilesRefStore>
The files backend behind this store, when it is one. Read more
Source§fn ref_lock_wait(&self) -> LockWait
fn ref_lock_wait(&self) -> LockWait
Auto Trait Implementations§
impl !Freeze for MemoryRefStore
impl RefUnwindSafe for MemoryRefStore
impl Send for MemoryRefStore
impl Sync for MemoryRefStore
impl Unpin for MemoryRefStore
impl UnsafeUnpin for MemoryRefStore
impl UnwindSafe for MemoryRefStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more