pub trait RegistryClient {
// Required methods
async fn get_manifest(
&self,
image: &str,
tag: &str,
) -> Result<ImageManifest>;
async fn download_layer(
&self,
image: &str,
digest: &str,
) -> Result<HttpResponse>;
async fn download_layer_with_range(
&self,
image: &str,
digest: &str,
start: u64,
) -> Result<HttpResponse>;
fn get_base_url(&self) -> &str;
}Expand description
镜像仓库客户端 trait
定义了与镜像仓库交互的核心方法,包括获取镜像 manifest 和下载镜像层。
Required Methods§
Sourceasync fn get_manifest(&self, image: &str, tag: &str) -> Result<ImageManifest>
async fn get_manifest(&self, image: &str, tag: &str) -> Result<ImageManifest>
Sourceasync fn download_layer(
&self,
image: &str,
digest: &str,
) -> Result<HttpResponse>
async fn download_layer( &self, image: &str, digest: &str, ) -> Result<HttpResponse>
Sourceasync fn download_layer_with_range(
&self,
image: &str,
digest: &str,
start: u64,
) -> Result<HttpResponse>
async fn download_layer_with_range( &self, image: &str, digest: &str, start: u64, ) -> Result<HttpResponse>
Sourcefn get_base_url(&self) -> &str
fn get_base_url(&self) -> &str
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.