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. TThe 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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more