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 open_image_optional( &self, imgref: &str, ) -> Result<Option<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: &Digest,
size: u64,
) -> Result<(impl AsyncBufRead + Send + Unpin, impl Future<Output = Result<()>> + Unpin + '_)>
pub async fn get_blob( &self, img: &OpenedImage, digest: &Digest, 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).
Note that because of the implementation details of this function, you should
[futures::join!
] the returned futures instead of polling one after the other. The
secondary “driver” future will only return once everything has been read from
the reader future.
Sourcepub async fn get_raw_blob(
&self,
img: &OpenedImage,
digest: &Digest,
) -> Result<(u64, File, impl Future<Output = Result<(), GetBlobError>> + Unpin + '_)>
pub async fn get_raw_blob( &self, img: &OpenedImage, digest: &Digest, ) -> Result<(u64, File, impl Future<Output = Result<(), GetBlobError>> + Unpin + '_)>
Fetch a blob identified by e.g. sha256:<digest>
; does not perform
any verification that the blob matches the digest. The size of the
blob and a pipe file descriptor are returned.
Sourcepub async fn get_descriptor(
&self,
img: &OpenedImage,
descriptor: &Descriptor,
) -> Result<(impl AsyncBufRead + Send + Unpin, impl Future<Output = Result<()>> + Unpin + '_)>
pub async fn get_descriptor( &self, img: &OpenedImage, descriptor: &Descriptor, ) -> Result<(impl AsyncBufRead + Send + Unpin, impl Future<Output = Result<()>> + Unpin + '_)>
Fetch a descriptor. 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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImageProxy
impl !RefUnwindSafe for ImageProxy
impl Send for ImageProxy
impl Sync for ImageProxy
impl Unpin for ImageProxy
impl !UnwindSafe for ImageProxy
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> 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