[go: up one dir, main page]

Struct git2::Reflog[][src]

pub struct Reflog { /* fields omitted */ }
Expand description

A reference log of a git repository.

Implementations

impl Reflog[src]

pub fn append(
    &mut self,
    new_oid: Oid,
    committer: &Signature<'_>,
    msg: Option<&str>
) -> Result<(), Error>
[src]

Add a new entry to the in-memory reflog.

pub fn remove(
    &mut self,
    i: usize,
    rewrite_previous_entry: bool
) -> Result<(), Error>
[src]

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.

pub fn get(&self, i: usize) -> Option<ReflogEntry<'_>>[src]

Lookup an entry by its index

Requesting the reflog entry with an index of 0 (zero) will return the most recently created entry.

pub fn len(&self) -> usize[src]

Get the number of log entries in a reflog

pub fn is_empty(&self) -> bool[src]

Return true is there is no log entry in a reflog

pub fn iter(&self) -> ReflogIter<'_>

Notable traits for ReflogIter<'reflog>

impl<'reflog> Iterator for ReflogIter<'reflog> type Item = ReflogEntry<'reflog>;
[src]

Get an iterator to all entries inside of this reflog

pub fn write(&mut self) -> Result<(), Error>[src]

Write an existing in-memory reflog object back to disk using an atomic file lock.

Trait Implementations

impl Drop for Reflog[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl RefUnwindSafe for Reflog

impl !Send for Reflog

impl !Sync for Reflog

impl Unpin for Reflog

impl UnwindSafe for Reflog

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.