pub struct RepologyClient { /* private fields */ }Expand description
Async client for the Repology API.
Constructed via RepologyClient::new or RepologyClient::builder.
Enforces rate limiting (1 request/sec by default) as required by the
Repology API policy.
Implementations§
Source§impl RepologyClient
impl RepologyClient
Sourcepub async fn project(&self, name: &str) -> Result<Vec<Package>>
pub async fn project(&self, name: &str) -> Result<Vec<Package>>
Fetch all packages for a single project by name.
Sourcepub async fn projects(
&self,
filter: &ProjectFilter,
) -> Result<HashMap<String, Vec<Package>>>
pub async fn projects( &self, filter: &ProjectFilter, ) -> Result<HashMap<String, Vec<Package>>>
Fetch all projects matching the given filter, automatically paginating through every page.
For large result sets, prefer projects_iter
to avoid loading everything into memory at once.
Sourcepub fn projects_iter<'a>(
&'a self,
filter: &'a ProjectFilter,
) -> Pin<Box<dyn Stream<Item = Result<(String, Vec<Package>)>> + 'a>>
pub fn projects_iter<'a>( &'a self, filter: &'a ProjectFilter, ) -> Pin<Box<dyn Stream<Item = Result<(String, Vec<Package>)>> + 'a>>
Returns a Stream that automatically paginates through all projects
matching the given filter, yielding (project_name, packages) pairs.
Uses projects_page under the hood.
Sourcepub async fn projects_page(
&self,
filter: &ProjectFilter,
cursor: Option<&str>,
) -> Result<HashMap<String, Vec<Package>>>
pub async fn projects_page( &self, filter: &ProjectFilter, cursor: Option<&str>, ) -> Result<HashMap<String, Vec<Package>>>
Fetch a single page of projects (up to ~200).
Pass None for the first page, then pass the last project name from
the previous page as the cursor to get the next page.
Sourcepub async fn repository_problems(
&self,
repository: &str,
) -> Result<Vec<Problem>>
pub async fn repository_problems( &self, repository: &str, ) -> Result<Vec<Problem>>
Fetch all problems for a repository, automatically paginating.
For large result sets, prefer
repository_problems_iter.
Sourcepub fn repository_problems_iter<'a>(
&'a self,
repository: &'a str,
) -> Pin<Box<dyn Stream<Item = Result<Problem>> + 'a>>
pub fn repository_problems_iter<'a>( &'a self, repository: &'a str, ) -> Pin<Box<dyn Stream<Item = Result<Problem>> + 'a>>
Returns a Stream that automatically paginates through all problems
for a repository.
Uses repository_problems_page
under the hood.
Sourcepub async fn repository_problems_page(
&self,
repository: &str,
cursor: Option<&str>,
) -> Result<Vec<Problem>>
pub async fn repository_problems_page( &self, repository: &str, cursor: Option<&str>, ) -> Result<Vec<Problem>>
Fetch a single page of problems for a repository.
Pass None for the first page, then pass the last project_name from
the previous page as the cursor to get the next page.
Sourcepub async fn maintainer_problems(
&self,
maintainer: &str,
repository: &str,
) -> Result<Vec<Problem>>
pub async fn maintainer_problems( &self, maintainer: &str, repository: &str, ) -> Result<Vec<Problem>>
Fetch all problems for a maintainer in a repository, automatically paginating.
For large result sets, prefer
maintainer_problems_iter.
Sourcepub fn maintainer_problems_iter<'a>(
&'a self,
maintainer: &'a str,
repository: &'a str,
) -> Pin<Box<dyn Stream<Item = Result<Problem>> + 'a>>
pub fn maintainer_problems_iter<'a>( &'a self, maintainer: &'a str, repository: &'a str, ) -> Pin<Box<dyn Stream<Item = Result<Problem>> + 'a>>
Returns a Stream that automatically paginates through all problems
for a maintainer in a repository.
Uses maintainer_problems_page
under the hood.
Sourcepub async fn maintainer_problems_page(
&self,
maintainer: &str,
repository: &str,
cursor: Option<&str>,
) -> Result<Vec<Problem>>
pub async fn maintainer_problems_page( &self, maintainer: &str, repository: &str, cursor: Option<&str>, ) -> Result<Vec<Problem>>
Fetch a single page of problems for a maintainer in a repository.
Pass None for the first page, then pass the last project_name from
the previous page as the cursor to get the next page.