pub struct Client { /* private fields */ }Expand description
A read-only registry client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn config(&self) -> &Config
pub fn config(&self) -> &Config
Returns a reference to the configuration this client was initialized with.
Sourcepub async fn with_global_defaults() -> Result<Self, Error>
pub async fn with_global_defaults() -> Result<Self, Error>
Returns a new client configured from default global config.
Sourcepub async fn list_all_versions(
&self,
package: &PackageRef,
) -> Result<Vec<VersionInfo>, Error>
pub async fn list_all_versions( &self, package: &PackageRef, ) -> Result<Vec<VersionInfo>, Error>
Returns a list of all package Versions available for the given package.
Sourcepub async fn get_release(
&self,
package: &PackageRef,
version: &Version,
) -> Result<Release, Error>
pub async fn get_release( &self, package: &PackageRef, version: &Version, ) -> Result<Release, Error>
Returns a Release for the given package version.
Sourcepub async fn stream_content<'a>(
&'a self,
package: &'a PackageRef,
release: &'a Release,
) -> Result<ContentStream, Error>
pub async fn stream_content<'a>( &'a self, package: &'a PackageRef, release: &'a Release, ) -> Result<ContentStream, Error>
Returns a ContentStream of content chunks. Contents are validated
against the given Release::content_digest.
Sourcepub async fn publish_release_file(
&self,
file: impl AsRef<Path>,
additional_options: PublishOpts,
) -> Result<(PackageRef, Version), Error>
pub async fn publish_release_file( &self, file: impl AsRef<Path>, additional_options: PublishOpts, ) -> Result<(PackageRef, Version), Error>
Publishes the given file as a package release. The package name and version will be read
from the component if not given as part of additional_options. Returns the package name
and version of the published release.
Sourcepub async fn publish_release_data(
&self,
data: PublishingSource,
additional_options: PublishOpts,
) -> Result<(PackageRef, Version), Error>
pub async fn publish_release_data( &self, data: PublishingSource, additional_options: PublishOpts, ) -> Result<(PackageRef, Version), Error>
Publishes the given reader as a package release. The package name and version will be read
from the component if not given as part of additional_options. Returns the package name
and version of the published release.