[][src]Struct crates_index_diff::Index

pub struct Index {
    pub seen_ref_name: &'static str,
    // some fields omitted
}

A wrapper for a repository of the crates.io index.

Fields

seen_ref_name: &'static str

The name and path of the reference used to keep track of the last seen state of the crates.io repository. The default value is refs/heads/crates-index-diff_last-seen.

Methods

impl Index[src]

pub fn repository(&self) -> &Repository[src]

Return the crates.io repository.

pub fn last_seen_reference(&self) -> Result<Reference, GitError>[src]

Return the reference pointing to the state we have seen after calling fetch_changes().

pub fn from_path_or_cloned<P>(path: P) -> Result<Index, GitError> where
    P: AsRef<Path>, 
[src]

Return a new Index instance from the given path, which should contain a bare or non-bare clone of the crates.io index. If the directory does not contain the repository or does not exist, it will be cloned from the official location automatically (with complete history).

pub fn fetch_changes(&self) -> Result<Vec<CrateVersion>, GitError>[src]

Return all CrateVersions that are observed between the last time this method was called and the latest state of the crates.io index repository, which is obtained by fetching the remote called origin. The last_seen_reference() will be created or adjusted to point to the latest fetched state, which causes this method to have a different result each time it is called.

pub fn changes<S1, S2>(
    &self,
    from: S1,
    to: S2
) -> Result<Vec<CrateVersion>, GitError> where
    S1: AsRef<str>,
    S2: AsRef<str>, 
[src]

Return all CreateVersions observed between from and to. Both parameter are ref-specs pointing to either a commit or a tree. Learn more about specifying revisions in the official documentation

pub fn changes_from_objects(
    &self,
    from: &Object,
    to: &Object
) -> Result<Vec<CrateVersion>, GitError>
[src]

Similar to changes(), but requires from and to objects to be provided. They may point to either Commits or Trees.

Auto Trait Implementations

impl Send for Index

impl Unpin for Index

impl !Sync for Index

impl UnwindSafe for Index

impl RefUnwindSafe for Index

Blanket Implementations

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

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

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.

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.

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

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

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