pub struct FilesRefStore { /* private fields */ }Expand description
Loose + packed ref storage on disk.
On Windows, updates whose storage path includes a reserved device name or another
non-round-tripping path component are rejected with RefStoreError::InvalidRefName
so repositories stay readable by system Git.
Implementations§
Source§impl FilesRefStore
impl FilesRefStore
Sourcepub fn open(config: FilesRefStoreConfig) -> Self
pub fn open(config: FilesRefStoreConfig) -> Self
Open a files backend at config.git_dir.
Sourcepub fn from_git_dir(git_dir: impl Into<PathBuf>) -> Result<Self>
pub fn from_git_dir(git_dir: impl Into<PathBuf>) -> Result<Self>
Convenience constructor for a simple repository directory.
Trait Implementations§
Source§impl Debug for FilesRefStore
impl Debug for FilesRefStore
Source§impl RefStore for FilesRefStore
impl RefStore for FilesRefStore
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 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 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 ref_lock_wait(&self) -> LockWait
fn ref_lock_wait(&self) -> LockWait
Auto Trait Implementations§
impl !Freeze for FilesRefStore
impl RefUnwindSafe for FilesRefStore
impl Send for FilesRefStore
impl Sync for FilesRefStore
impl Unpin for FilesRefStore
impl UnsafeUnpin for FilesRefStore
impl UnwindSafe for FilesRefStore
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