pub struct Client { /* private fields */ }
Expand description
A read-only registry client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(config: ClientConfig) -> Self
pub fn new(config: ClientConfig) -> Self
Returns a new client with the given ClientConfig
.
Sourcepub fn from_default_config_file() -> Result<Option<Self>, Error>
pub fn from_default_config_file() -> Result<Option<Self>, Error>
Returns a new client configured from the default config file path. Returns Ok(None) if the default config file does not exist.
Sourcepub async fn list_all_versions(
&mut self,
package: &PackageRef,
) -> Result<Vec<Version>, Error>
pub async fn list_all_versions( &mut self, package: &PackageRef, ) -> Result<Vec<Version>, Error>
Returns a list of all package Version
s available for the given package.
Sourcepub async fn get_release(
&mut self,
package: &PackageRef,
version: &Version,
) -> Result<Release, Error>
pub async fn get_release( &mut self, package: &PackageRef, version: &Version, ) -> Result<Release, Error>
Returns a Release
for the given package version.
Sourcepub async fn stream_content(
&mut self,
package: &PackageRef,
release: &Release,
) -> Result<BoxStream<'_, Result<Bytes, Error>>, Error>
pub async fn stream_content( &mut self, package: &PackageRef, release: &Release, ) -> Result<BoxStream<'_, Result<Bytes, Error>>, Error>
Returns a BoxStream
of content chunks. Contents are validated
against the given Release::content_digest
.
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