Expand description
A git ref which is stored in a file.
Fields
name: FullName
The path to uniquely identify this ref within its store.
target: Target
The target of the reference, either a symbolic reference by full name or an object by its id.
Implementations
sourceimpl Reference
impl Reference
sourcepub fn log_exists(&self, store: &Store) -> bool
pub fn log_exists(&self, store: &Store) -> bool
Returns true if a reflog exists in the given store
.
Please note that this method shouldn’t be used to check if a log exists before trying to read it, but instead is meant to be the fastest possible way to determine if a log exists or not. If the caller needs to know if it’s readable, try to read the log instead with a reverse or forward iterator.
sourcepub fn log_iter_rev<'b>(
&self,
store: &Store,
buf: &'b mut [u8]
) -> Result<Option<Reverse<'b, File>>>
pub fn log_iter_rev<'b>(
&self,
store: &Store,
buf: &'b mut [u8]
) -> Result<Option<Reverse<'b, File>>>
Return a reflog reverse iterator for this ref, reading chunks from the back into the fixed buffer buf
, in the given store
.
The iterator will traverse log entries from most recent to oldest, reading the underlying file in chunks from the back.
Return Ok(None)
if no reflog exists.
sourcepub fn log_iter<'a, 'b: 'a>(
&'a self,
store: &Store,
buf: &'b mut Vec<u8>
) -> Result<Option<impl Iterator<Item = Result<LineRef<'b>, Error>> + 'a>>
pub fn log_iter<'a, 'b: 'a>(
&'a self,
store: &Store,
buf: &'b mut Vec<u8>
) -> Result<Option<impl Iterator<Item = Result<LineRef<'b>, Error>> + 'a>>
Return a reflog forward iterator for this ref and write its file contents into buf
, in the given store
.
The iterator will traverse log entries from oldest to newest.
Return Ok(None)
if no reflog exists.
Trait Implementations
sourceimpl Ord for Reference
impl Ord for Reference
sourceimpl PartialOrd<Reference> for Reference
impl PartialOrd<Reference> for Reference
sourcefn partial_cmp(&self, other: &Reference) -> Option<Ordering>
fn partial_cmp(&self, other: &Reference) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for Reference
impl StructuralEq for Reference
impl StructuralPartialEq for Reference
Auto Trait Implementations
impl RefUnwindSafe for Reference
impl Send for Reference
impl Sync for Reference
impl Unpin for Reference
impl UnwindSafe for Reference
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more