[][src]Struct crates_io_api::AsyncClient

pub struct AsyncClient { /* fields omitted */ }

Asynchronous client for the crates.io API.

Methods

impl Client[src]

pub fn new() -> Self[src]

Instantiate a new client.

This will fail if the underlying http client could not be created.

pub fn with_user_agent(user_agent: &str) -> Self[src]

pub fn summary(&self) -> impl Future<Item = Summary, Error = Error>[src]

Retrieve a summary containing crates.io wide information.

pub fn get_crate(
    &self,
    name: &str
) -> impl Future<Item = CrateResponse, Error = Error>
[src]

Retrieve information of a crate.

If you require detailed information, consider using full_crate.

pub fn crate_downloads(
    &self,
    name: &str
) -> impl Future<Item = Downloads, Error = Error>
[src]

Retrieve download stats for a crate.

pub fn crate_owners(
    &self,
    name: &str
) -> impl Future<Item = Vec<User>, Error = Error>
[src]

Retrieve the owners of a crate.

pub fn crate_reverse_dependencies(
    &self,
    name: &str
) -> impl Future<Item = ReverseDependencies, Error = Error>
[src]

Load all reverse dependencies of a crate.

Note: Since the reverse dependency endpoint requires pagination, this will result in multiple requests if the crate has more than 100 reverse dependencies.

pub fn crate_authors(
    &self,
    name: &str,
    version: &str
) -> impl Future<Item = Authors, Error = Error>
[src]

Retrieve the authors for a crate version.

pub fn crate_dependencies(
    &self,
    name: &str,
    version: &str
) -> impl Future<Item = Vec<Dependency>, Error = Error>
[src]

Retrieve the dependencies of a crate version.

pub fn full_crate(
    &self,
    name: &str,
    all_versions: bool
) -> impl Future<Item = FullCrate, Error = Error>
[src]

Retrieve all available information for a crate, including download stats, owners and reverse dependencies.

The all_versions argument controls the retrieval of detailed version information. If false, only the data for the latest version will be fetched, if true, detailed information for all versions will be available. Note: Each version requires two extra requests.

pub fn crates(
    &self,
    spec: ListOptions
) -> impl Future<Item = CratesResponse, Error = Error>
[src]

Retrieve a page of crates, optionally constrained by a query.

If you want to get all results without worrying about paging, use all_crates.

pub fn all_crates(
    &self,
    query: Option<String>
) -> impl Stream<Item = Crate, Error = Error>
[src]

Retrieve all crates, optionally constrained by a query.

Note: This method fetches all pages of the result. This can result in a lot queries (100 results per query).

pub fn all_crates_full(
    &self,
    query: Option<String>,
    all_versions: bool
) -> impl Stream<Item = FullCrate, Error = Error>
[src]

Retrieve all crates with all available extra information.

Note: This method fetches not only all crates, but does multiple requests for each crate to retrieve extra information.

This can result in A LOT of queries.

Trait Implementations

impl Clone for Client[src]

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

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Client

impl Unpin for Client

impl Sync for Client

impl !UnwindSafe for Client

impl !RefUnwindSafe for Client

Blanket Implementations

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.

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

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

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

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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