[][src]Struct crates_index::Index

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[src]

Retrieve an iterator over all the crates in the index

pub fn crate_index_paths(&self) -> CrateIndexPaths[src]

Returns all the crate index file paths in the index

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

Get the index directory.

Trait Implementations

impl Clone for Index[src]

impl Debug for Index[src]

impl PartialEq<Index> for Index[src]

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]

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.