Skip to main content

EmptyRepository

Struct EmptyRepository 

Source
pub struct EmptyRepository<'a> { /* private fields */ }
Expand description

An empty repository whose HEAD points at an unborn branch.

Implementations§

Source§

impl<'a> EmptyRepository<'a>

Source

pub fn new(target: &'a str) -> Result<Self>

Source

pub fn new_with_format(target: &'a str, format: ObjectFormat) -> Result<Self>

Trait Implementations§

Source§

impl<'a> Clone for EmptyRepository<'a>

Source§

fn clone(&self) -> Self

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<'a> Copy for EmptyRepository<'a>

Source§

impl<'a> Debug for EmptyRepository<'a>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Repository for EmptyRepository<'_>

Source§

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

Fixed for the entire repository, including unborn HEAD. Defaults to SHA-1; SHA-256 providers must override this independently of object_id.
Source§

fn head_state(&self) -> Head<'_>

Source§

fn head_ref(&self) -> &str

Source§

fn object_count(&self) -> usize

Source§

fn reference_count(&self) -> usize

Source§

fn reference_name(&self, _index: usize) -> Option<&str>

Source§

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.
Source§

fn object_info(&self, index: usize) -> Result<ObjectInfo>

Source§

fn read_object( &self, index: usize, offset: u64, storage: &mut [u8], ) -> Result<usize>

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>

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>

Defaults preserve snapshot commit aliases. Override for independent tips.
Source§

fn reference_symbolic_target(&self, _index: usize) -> Option<&str>

Source§

fn reference_peeled(&self, _index: usize) -> Option<ObjectId>

Source§

fn find(&self, id: ObjectId) -> Option<Object<'_>>

Source§

fn find_index(&self, id: ObjectId) -> Option<usize>

Lookup without requiring a borrowed body. Metadata providers can index it.

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.