Struct consecrates::Client [−][src]
API client abstraction.
Implementations
impl Client
[src]
pub fn new(user_agent: &str) -> Self
[src]
Creates a new client with the given user agent string.
User-agent requirement
crates.io
requires the requests to include a user-agent header.
Here are a few examples of proper user-agent strings you can use:
my_crawler (my_crawler.com/info)
my_crawler (help@my_crawler.com)
my_crawler (github.com/me/my_crawler)
pub fn new_with_base_url(base_url: &str, user_agent: &str) -> Self
[src]
Creates a new client with the given base url and user agent string.
pub fn get_crates(&self, query: Query) -> Result<Crates>
[src]
Gets a page of crates, using a set of query options.
pub fn try_get_crates(&self, query: Query) -> Result<Crates>
[src]
Tries to get a page of crates, using a set of query options.
pub fn get_crate(&self, crate_id: &str) -> Result<Crate>
[src]
Gets information about a particular crate.
pub fn try_get_crate(&self, crate_id: &str) -> Result<Crate>
[src]
Tries to get information about a particular crate.
pub fn get_crate_version(
&self,
crate_id: &str,
crate_version: &str
) -> Result<Version>
[src]
&self,
crate_id: &str,
crate_version: &str
) -> Result<Version>
Gets crate information for a particular version of the given crate.
pub fn try_get_crate_version(
&self,
crate_id: &str,
crate_version: &str
) -> Result<Version>
[src]
&self,
crate_id: &str,
crate_version: &str
) -> Result<Version>
Tries to get crate information for a particular version of the given crate.
pub fn get_crate_downloads(&self, crate_id: &str) -> Result<Downloads>
[src]
Gets information about the download stats for the given crate.
pub fn try_get_crate_downloads(&self, crate_id: &str) -> Result<Downloads>
[src]
Tries to get information about the download stats for the given crate.
pub fn get_crate_dependencies(
&self,
crate_id: &str,
crate_version: &str
) -> Result<Dependencies>
[src]
&self,
crate_id: &str,
crate_version: &str
) -> Result<Dependencies>
Gets a list of dependencies for a particular version of the given crate.
pub fn try_get_crate_dependencies(
&self,
crate_id: &str,
crate_version: &str
) -> Result<Dependencies>
[src]
&self,
crate_id: &str,
crate_version: &str
) -> Result<Dependencies>
Tries to get a list of dependencies for a particular version of the given crate.
pub fn get_crate_owners(&self, crate_id: &str) -> Result<Owners>
[src]
Gets information about the owners of the given crate.
pub fn try_get_crate_owners(&self, crate_id: &str) -> Result<Owners>
[src]
Tries to get information about the owners of the given crate.
pub fn get_crate_authors(
&self,
crate_id: &str,
crate_version: &str
) -> Result<Authors>
[src]
&self,
crate_id: &str,
crate_version: &str
) -> Result<Authors>
Gets information about the authors for a particular version of the given crate.
pub fn try_get_crate_authors(
&self,
crate_id: &str,
crate_version: &str
) -> Result<Authors>
[src]
&self,
crate_id: &str,
crate_version: &str
) -> Result<Authors>
Tries to get information about the authors for a particular version of the given crate.
pub fn get_crate_readme(
&self,
crate_id: &str,
crate_version: &str
) -> Result<String>
[src]
&self,
crate_id: &str,
crate_version: &str
) -> Result<String>
Gets the readme for a particular version of the given crate.
pub fn try_get_crate_readme(
&self,
crate_id: &str,
crate_version: &str
) -> Result<String>
[src]
&self,
crate_id: &str,
crate_version: &str
) -> Result<String>
Tries to get the readme for a particular version of the given crate.
pub fn get_registry_summary(&self) -> Result<Summary>
[src]
Gets registry-wide summary.
pub fn try_get_registry_summary(&self) -> Result<Summary>
[src]
Tries to get registry-wide summary.
pub fn get_category(&self, query: Query) -> Result<Category>
[src]
Gets information about a category.
Query details
This function accepts a Query
object but can only use it's string
or category
fields.
pub fn try_get_category(&self, query: Query) -> Result<Category>
[src]
Tries to get information about a category.
Query details
This function accepts a Query
object but can only use it's string
or category
fields.
pub fn get_categories(&self, query: Query) -> Result<Categories>
[src]
Gets a paged list of categories available with the registry.
Query details
This function accepts a Query
object but can only use it's page
and per_page
fields.
pub fn try_get_categories(&self, query: Query) -> Result<Categories>
[src]
Tries to get a paged list of categories available with the registry.
Query details
This function accepts a Query
object but can only use it's page
and per_page
fields.
pub fn get_keyword(&self, query: Query) -> Result<Keyword>
[src]
Gets information about a category.
Query details
This function accepts a Query
object but can only use it's string
or keyword
fields.
pub fn try_get_keyword(&self, query: Query) -> Result<Keyword>
[src]
Tries to get information about a category.
Query details
This function accepts a Query
object but can only use it's string
or keyword
fields.
pub fn get_keywords(&self, query: Query) -> Result<Keywords>
[src]
Gets a paged list of keywords used by crates within the registry.
Query details
This function accepts a Query
object but can only use it's page
and per_page
fields.
pub fn try_get_keywords(&self, query: Query) -> Result<Keywords>
[src]
Tries to get a paged list of keywords used by crates within the registry.
Query details
This function accepts a Query
object but can only use it's page
and per_page
fields.
Auto Trait Implementations
impl RefUnwindSafe for Client
[src]
impl Send for Client
[src]
impl Sync for Client
[src]
impl Unpin for Client
[src]
impl UnwindSafe for Client
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,