pub struct EmptyRepository<'a> { /* private fields */ }Expand description
An empty repository whose HEAD points at an unborn branch.
Implementations§
Source§impl<'a> EmptyRepository<'a>
impl<'a> EmptyRepository<'a>
pub fn new(target: &'a str) -> Result<EmptyRepository<'a>, Error>
pub fn new_with_format( target: &'a str, format: ObjectFormat, ) -> Result<EmptyRepository<'a>, Error>
Trait Implementations§
Source§impl<'a> Clone for EmptyRepository<'a>
impl<'a> Clone for EmptyRepository<'a>
Source§fn clone(&self) -> EmptyRepository<'a>
fn clone(&self) -> EmptyRepository<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for EmptyRepository<'a>
Source§impl<'a> Debug for EmptyRepository<'a>
impl<'a> Debug for EmptyRepository<'a>
Source§impl Repository for EmptyRepository<'_>
impl Repository for EmptyRepository<'_>
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
fn reference_count(&self) -> usize
fn reference_name(&self, _index: usize) -> Option<&str>
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 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 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 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<'a> Freeze for EmptyRepository<'a>
impl<'a> RefUnwindSafe for EmptyRepository<'a>
impl<'a> Send for EmptyRepository<'a>
impl<'a> Sync for EmptyRepository<'a>
impl<'a> Unpin for EmptyRepository<'a>
impl<'a> UnsafeUnpin for EmptyRepository<'a>
impl<'a> UnwindSafe for EmptyRepository<'a>
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