Struct crates_index::Index[][src]

pub struct Index { /* fields omitted */ }

Wrapper around managing the crates.io-index git repository

Implementations

impl Index[src]

pub fn new<P: Into<PathBuf>>(path: P) -> Index[src]

Construct a new Index supplying a path where the index lives or should live

pub fn new_cargo_default() -> Index[src]

Use Cargo’s own index in CARGO_HOME (~/.cargo/registry/index)

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

Determines if a crates.io repository exists at self.path

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

Downloads the index to the path specified from the constructor

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

Assumes the index already exists at self.path, and updates it

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

Downloads the index to the path specified from the constructor

pub fn crate_(&self, crate_name: &str) -> Option<Crate>[src]

Retrieve a single crate by name (case insensitive) from the index

pub fn crates(&self) -> Crates

Notable traits for Crates

impl Iterator for Crates type Item = Crate;
[src]

Retrieve an iterator over all the crates in the index

pub fn crate_index_paths(&self) -> CrateIndexPaths

Notable traits for CrateIndexPaths

impl Iterator for CrateIndexPaths type Item = PathBuf;
[src]

👎 Deprecated:

This method won’t work with BareIndex

Returns all the crate index file paths in the index

pub fn path(&self) -> &Path[src]

Get the index directory.

pub fn index_config(&self) -> Result<IndexConfig, Error>[src]

Get the global configuration of the index.

Trait Implementations

impl Clone for Index[src]

fn clone(&self) -> Index[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Index[src]

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

Formats the value using the given formatter. Read more

impl PartialEq<Index> for Index[src]

fn eq(&self, other: &Index) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Index) -> bool[src]

This method tests for !=.

impl StructuralPartialEq for Index[src]

Auto Trait Implementations

impl RefUnwindSafe for Index

impl Send for Index

impl Sync for Index

impl Unpin for Index

impl UnwindSafe for Index

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.