pub struct PyPIClient { /* private fields */ }Expand description
PyPI index client for fetching package metadata
Implementations§
Source§impl PyPIClient
impl PyPIClient
Sourcepub fn with_url(base_url: impl Into<String>) -> Self
pub fn with_url(base_url: impl Into<String>) -> Self
Create a new PyPI client with a custom index URL
Sourcepub fn from_registry(config: &RegistryConfig) -> Result<Self>
pub fn from_registry(config: &RegistryConfig) -> Result<Self>
Create a client from a registry configuration
Sourcepub fn with_credentials(self, credentials: ResolvedCredentials) -> Self
pub fn with_credentials(self, credentials: ResolvedCredentials) -> Self
Set credentials for authentication
Sourcepub async fn get_package(&self, name: &str) -> Result<PackageMetadata>
pub async fn get_package(&self, name: &str) -> Result<PackageMetadata>
Fetch package metadata from PyPI
Sourcepub async fn get_package_version(
&self,
name: &str,
version: &str,
) -> Result<PackageMetadata>
pub async fn get_package_version( &self, name: &str, version: &str, ) -> Result<PackageMetadata>
Fetch metadata for a specific version
Sourcepub async fn get_versions(&self, name: &str) -> Result<Vec<Version>>
pub async fn get_versions(&self, name: &str) -> Result<Vec<Version>>
Get all available versions for a package
Sourcepub async fn get_available_versions(&self, name: &str) -> Result<Vec<Version>>
pub async fn get_available_versions(&self, name: &str) -> Result<Vec<Version>>
Get available versions that have non-yanked files
Sourcepub async fn get_packages_concurrent(
&self,
names: &[String],
) -> HashMap<String, Result<PackageMetadata>>
pub async fn get_packages_concurrent( &self, names: &[String], ) -> HashMap<String, Result<PackageMetadata>>
Fetch metadata for multiple packages concurrently
Sourcepub async fn clear_cache(&self)
pub async fn clear_cache(&self)
Clear the metadata cache
Trait Implementations§
Source§impl Clone for PyPIClient
impl Clone for PyPIClient
Source§fn clone(&self) -> PyPIClient
fn clone(&self) -> PyPIClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PyPIClient
impl !RefUnwindSafe for PyPIClient
impl Send for PyPIClient
impl Sync for PyPIClient
impl Unpin for PyPIClient
impl !UnwindSafe for PyPIClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more