Struct crates_io_api::SyncClient [−][src]
pub struct SyncClient { /* fields omitted */ }
A synchronous client for the crates.io API.
Methods
impl SyncClient
[src]
impl SyncClient
pub fn new() -> Self
[src]
pub fn new() -> Self
Instantiate a new synchronous API client.
This will fail if the underlying http client could not be created.
pub fn summary(&self) -> Result<Summary, Error>
[src]
pub fn summary(&self) -> Result<Summary, Error>
Retrieve a summary containing crates.io wide information.
pub fn get_crate(&self, name: &str) -> Result<CrateResponse, Error>
[src]
pub fn get_crate(&self, name: &str) -> Result<CrateResponse, Error>
Retrieve information of a crate.
If you require detailed information, consider using full_crate.
pub fn crate_downloads(&self, name: &str) -> Result<Downloads, Error>
[src]
pub fn crate_downloads(&self, name: &str) -> Result<Downloads, Error>
Retrieve download stats for a crate.
pub fn crate_owners(&self, name: &str) -> Result<Vec<User>, Error>
[src]
pub fn crate_owners(&self, name: &str) -> Result<Vec<User>, Error>
Retrieve the owners of a crate.
pub fn crate_reverse_dependencies(
&self,
name: &str
) -> Result<Vec<Dependency>, Error>
[src]
pub fn crate_reverse_dependencies(
&self,
name: &str
) -> Result<Vec<Dependency>, Error>
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.
Retrieve the authors for a crate version.
pub fn crate_dependencies(
&self,
name: &str,
version: &str
) -> Result<Vec<Dependency>, Error>
[src]
pub fn crate_dependencies(
&self,
name: &str,
version: &str
) -> Result<Vec<Dependency>, Error>
Retrieve the dependencies of a crate version.
pub fn full_crate(
&self,
name: &str,
all_versions: bool
) -> Result<FullCrate, Error>
[src]
pub fn full_crate(
&self,
name: &str,
all_versions: bool
) -> Result<FullCrate, Error>
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) -> Result<CratesResponse, Error>
[src]
pub fn crates(&self, spec: ListOptions) -> Result<CratesResponse, Error>
Retrieve a page of crates, optionally constrained by a query.
If you want to get all results without worrying about paging, use all_crates.
Examples
Retrieve the first page of results for the query "api", with 100 items per page and sorted alphabetically.
let client = SyncClient::new(); client.crates(ListOptions{ sort: Sort::Alphabetical, per_page: 100, page: 1, query: Some("api".to_string()), })?;
pub fn all_crates(&self, query: Option<String>) -> Result<Vec<Crate>, Error>
[src]
pub fn all_crates(&self, query: Option<String>) -> Result<Vec<Crate>, Error>
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).
Auto Trait Implementations
impl Send for SyncClient
impl Send for SyncClient
impl Sync for SyncClient
impl Sync for SyncClient