pub struct RefRepository<'refs, 'repo, R>where
R: Repository + ?Sized,{ /* private fields */ }Expand description
Attach a caller-owned sorted ref manifest and HEAD to an object provider.
Construction validates refs and symbolic links, without reading object bodies.
Use ValidatedRepository to check IDs, target kinds, tags and the union graph.
Implementations§
Source§impl<'refs, 'repo, R> RefRepository<'refs, 'repo, R>where
R: Repository + ?Sized,
impl<'refs, 'repo, R> RefRepository<'refs, 'repo, R>where
R: Repository + ?Sized,
Trait Implementations§
Source§impl<R> Repository for RefRepository<'_, '_, R>where
R: Repository + ?Sized,
impl<R> Repository for RefRepository<'_, '_, R>where
R: Repository + ?Sized,
Source§fn head(&self) -> ObjectId
fn head(&self) -> ObjectId
Resolved commit ID, or the all-zero sentinel for an unborn HEAD.
Use
head_state().id() when absence needs to be distinguished.Source§fn object_format(&self) -> ObjectFormat
fn object_format(&self) -> ObjectFormat
Fixed for the entire repository, including unborn HEAD. Defaults to
SHA-1; SHA-256 providers must override this independently of
object_id.fn head_state(&self) -> Head<'_>
fn head_ref(&self) -> &str
fn object_count(&self) -> usize
Source§fn object(&self, index: usize) -> Option<Object<'_>>
fn object(&self, index: usize) -> Option<Object<'_>>
Optional borrowed-body fast path. Streaming providers can leave this as
None and implement object_info, read_object, and object_id instead.fn object_info(&self, index: usize) -> Result<ObjectInfo, Error>
Source§fn object_id(&self, index: usize) -> Option<ObjectId>
fn object_id(&self, index: usize) -> Option<ObjectId>
Return an object’s ID. Streaming providers must supply precomputed IDs;
ObjectHasher computes them incrementally with caller-owned scratch.Source§fn read_object(
&self,
index: usize,
offset: u64,
storage: &mut [u8],
) -> Result<usize, Error>
fn read_object( &self, index: usize, offset: u64, storage: &mut [u8], ) -> Result<usize, Error>
Read at most
storage.len() body bytes starting at a byte offset.
Short reads are allowed. Return zero only at EOF or for empty storage.
Calls must be independent of earlier reads, enabling interleaved readers
and retries. Errors may modify storage but must not change the object.Source§fn find_index(&self, id: ObjectId) -> Option<usize>
fn find_index(&self, id: ObjectId) -> Option<usize>
Lookup without requiring a borrowed body. Metadata providers can index it.
fn reference_count(&self) -> usize
fn reference_name(&self, index: usize) -> Option<&str>
Source§fn reference_id(&self, index: usize) -> Option<ObjectId>
fn reference_id(&self, index: usize) -> Option<ObjectId>
Defaults preserve snapshot commit aliases. Override for independent tips.
fn reference_symbolic_target(&self, index: usize) -> Option<&str>
fn reference_peeled(&self, index: usize) -> Option<ObjectId>
fn find(&self, id: ObjectId) -> Option<Object<'_>>
Auto Trait Implementations§
impl<'refs, 'repo, R> Freeze for RefRepository<'refs, 'repo, R>
impl<'refs, 'repo, R> RefUnwindSafe for RefRepository<'refs, 'repo, R>
impl<'refs, 'repo, R> Send for RefRepository<'refs, 'repo, R>
impl<'refs, 'repo, R> Sync for RefRepository<'refs, 'repo, R>
impl<'refs, 'repo, R> Unpin for RefRepository<'refs, 'repo, R>
impl<'refs, 'repo, R> UnsafeUnpin for RefRepository<'refs, 'repo, R>
impl<'refs, 'repo, R> UnwindSafe for RefRepository<'refs, 'repo, R>
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