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

source

pub async fn new() -> Result<Self>

Create an image proxy that fetches the target image, using default configuration.

source

pub async fn new_with_config(config: ImageProxyConfig) -> Result<Self>

Create an image proxy that fetches the target image

source

pub async fn open_image(&self, imgref: &str) -> Result<OpenedImage>

source

pub async fn close_image(&self, img: &OpenedImage) -> Result<()>

source

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

source

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

source

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

source

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

source

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).

source

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.

source

pub async fn finalize(self) -> Result<()>

Close the connection and wait for the child process to exit successfully.

Trait Implementations§

source§

impl Debug for ImageProxy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more