Struct wasm_pkg_client::Client
source · pub struct Client { /* private fields */ }Expand description
A read-only registry client.
Implementations§
source§impl Client
impl Client
sourcepub fn with_global_defaults() -> Result<Self, Error>
pub 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.
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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