[][src]Trait hexpm::Client

pub trait Client {
    pub fn http_client(&self) -> Client;
pub fn api_base_url(&self) -> &Url;
pub fn repository_base_url(&self) -> &Url; #[must_use] pub fn authenticate<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        password: &'life2 str,
        token_name: &'life3 str
    ) -> Pin<Box<dyn Future<Output = Result<AuthenticatedClient, AuthenticateError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] pub fn get_repository_versions<'life0, 'life1, 'async_trait>(
        &'life0 self,
        public_key: &'life1 [u8]
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Vec<String>>, GetRepositoryVersionsError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] pub fn get_package<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        public_key: &'life2 [u8]
    ) -> Pin<Box<dyn Future<Output = Result<Package, GetPackageError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: Sync + 'async_trait
, { ... } }

Required methods

pub fn http_client(&self) -> Client[src]

pub fn api_base_url(&self) -> &Url[src]

pub fn repository_base_url(&self) -> &Url[src]

Loading content...

Provided methods

#[must_use]pub fn authenticate<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 self,
    username: &'life1 str,
    password: &'life2 str,
    token_name: &'life3 str
) -> Pin<Box<dyn Future<Output = Result<AuthenticatedClient, AuthenticateError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: Sync + 'async_trait, 
[src]

Authenticate with the Hex API using a username and password in order to get an API token, enabling accessing of more APIs and raising the rate limit.

#[must_use]pub fn get_repository_versions<'life0, 'life1, 'async_trait>(
    &'life0 self,
    public_key: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Vec<String>>, GetRepositoryVersionsError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: Sync + 'async_trait, 
[src]

Get the names and versions of all of the packages on the package registry.

#[must_use]pub fn get_package<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    name: &'life1 str,
    public_key: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Result<Package, GetPackageError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: Sync + 'async_trait, 
[src]

Get the information for a package in the repository.

Loading content...

Implementors

impl Client for AuthenticatedClient[src]

impl Client for UnauthenticatedClient[src]

Loading content...