Struct containers_image_proxy::ImageProxy
source · pub struct ImageProxy { /* private fields */ }
Expand description
Manage a child process proxy to fetch container images.
Implementations§
source§impl ImageProxy
impl ImageProxy
sourcepub async fn new() -> Result<Self>
pub async fn new() -> Result<Self>
Create an image proxy that fetches the target image, using default configuration.
sourcepub async fn new_with_config(config: ImageProxyConfig) -> Result<Self>
pub async fn new_with_config(config: ImageProxyConfig) -> Result<Self>
Create an image proxy that fetches the target image
pub async fn open_image(&self, imgref: &str) -> Result<OpenedImage>
pub async fn close_image(&self, img: &OpenedImage) -> Result<()>
sourcepub async fn fetch_manifest_raw_oci(
&self,
img: &OpenedImage
) -> Result<(String, Vec<u8>)>
pub async fn fetch_manifest_raw_oci( &self, img: &OpenedImage ) -> Result<(String, Vec<u8>)>
Fetch the manifest as raw bytes, converted to OCI if necessary. The original digest of the unconverted manifest is also returned. For more information on OCI manifests, see https://github.com/opencontainers/image-spec/blob/main/manifest.md
sourcepub async fn fetch_manifest(
&self,
img: &OpenedImage
) -> Result<(String, ImageManifest)>
pub async fn fetch_manifest( &self, img: &OpenedImage ) -> Result<(String, ImageManifest)>
Fetch the manifest. For more information on OCI manifests, see https://github.com/opencontainers/image-spec/blob/main/manifest.md
sourcepub async fn fetch_config_raw(&self, img: &OpenedImage) -> Result<Vec<u8>>
pub async fn fetch_config_raw(&self, img: &OpenedImage) -> Result<Vec<u8>>
Fetch the config. For more information on OCI config, see https://github.com/opencontainers/image-spec/blob/main/config.md
sourcepub async fn fetch_config(
&self,
img: &OpenedImage
) -> Result<ImageConfiguration>
pub async fn fetch_config( &self, img: &OpenedImage ) -> Result<ImageConfiguration>
Fetch the config. For more information on OCI config, see https://github.com/opencontainers/image-spec/blob/main/config.md
sourcepub async fn get_blob(
&self,
img: &OpenedImage,
digest: &str,
size: u64
) -> Result<(impl AsyncBufRead + Send + Unpin, impl Future<Output = Result<()>> + Unpin + '_)>
pub async fn get_blob( &self, img: &OpenedImage, digest: &str, size: u64 ) -> Result<(impl AsyncBufRead + Send + Unpin, impl Future<Output = Result<()>> + Unpin + '_)>
Fetch a blob identified by e.g. sha256:<digest>
.
https://github.com/opencontainers/image-spec/blob/main/descriptor.md
The requested size and digest are verified (by the proxy process).
sourcepub async fn get_layer_info(
&self,
img: &OpenedImage
) -> Result<Option<Vec<ConvertedLayerInfo>>>
pub async fn get_layer_info( &self, img: &OpenedImage ) -> Result<Option<Vec<ConvertedLayerInfo>>>
Returns data that can be used to find the “diffid” corresponding to a particular layer.