pub struct Reflog { /* private fields */ }Expand description
A reference log of a git repository.
Implementations§
Source§impl Reflog
impl Reflog
Sourcepub fn append(
&mut self,
new_oid: Oid,
committer: &Signature<'_>,
msg: Option<&str>,
) -> Result<(), Error>
pub fn append( &mut self, new_oid: Oid, committer: &Signature<'_>, msg: Option<&str>, ) -> Result<(), Error>
Add a new entry to the in-memory reflog.
Sourcepub fn remove(
&mut self,
i: usize,
rewrite_previous_entry: bool,
) -> Result<(), Error>
pub fn remove( &mut self, i: usize, rewrite_previous_entry: bool, ) -> Result<(), Error>
Remove an entry from the reflog by its index
To ensure there’s no gap in the log history, set rewrite_previous_entry
param value to true. When deleting entry n, member old_oid of entry
n-1 (if any) will be updated with the value of member new_oid of entry
n+1.
Sourcepub fn get(&self, i: usize) -> Option<ReflogEntry<'_>>
pub fn get(&self, i: usize) -> Option<ReflogEntry<'_>>
Lookup an entry by its index
Requesting the reflog entry with an index of 0 (zero) will return the most recently created entry.
Sourcepub fn iter(&self) -> ReflogIter<'_> ⓘ
pub fn iter(&self) -> ReflogIter<'_> ⓘ
Get an iterator to all entries inside of this reflog
Trait Implementations§
Source§impl Binding for Reflog
impl Binding for Reflog
Source§type Raw = *mut git_reflog
type Raw = *mut git_reflog
The raw type that allows you to interact with libgit2-sys.
Source§unsafe fn from_raw(raw: *mut git_reflog) -> Reflog
unsafe fn from_raw(raw: *mut git_reflog) -> Reflog
Build a git2 struct from its Binding::Raw value.
Source§fn raw(&self) -> *mut git_reflog
fn raw(&self) -> *mut git_reflog
Access the Binding::Raw value for a struct. Read more
Source§unsafe fn from_raw_opt<T>(raw: T) -> Option<Self>
unsafe fn from_raw_opt<T>(raw: T) -> Option<Self>
A null-handling version of Binding::from_raw. Read more
Auto Trait Implementations§
impl Freeze for Reflog
impl RefUnwindSafe for Reflog
impl !Send for Reflog
impl !Sync for Reflog
impl Unpin for Reflog
impl UnsafeUnpin for Reflog
impl UnwindSafe for Reflog
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