pub struct ImagePuller { /* private fields */ }Expand description
High-level image puller with caching.
Implementations§
Source§impl ImagePuller
impl ImagePuller
Sourcepub fn new(store: Arc<ImageStore>, auth: RegistryAuth) -> Self
pub fn new(store: Arc<ImageStore>, auth: RegistryAuth) -> Self
Create a new image puller.
Sourcepub fn with_platform(
store: Arc<ImageStore>,
auth: RegistryAuth,
platform: Option<String>,
) -> Self
pub fn with_platform( store: Arc<ImageStore>, auth: RegistryAuth, platform: Option<String>, ) -> Self
Create an image puller that resolves multi-arch images to an explicit
platform (e.g. “linux/arm64”) instead of the host architecture. None
keeps the host-architecture default.
Sourcepub fn set_metrics(self, metrics: RuntimeMetrics) -> Self
pub fn set_metrics(self, metrics: RuntimeMetrics) -> Self
Attach Prometheus metrics to this puller.
Sourcepub fn with_signature_policy(self, policy: SignaturePolicy) -> Self
pub fn with_signature_policy(self, policy: SignaturePolicy) -> Self
Set the signature verification policy for image pulls.
Sourcepub fn with_progress_fn(
self,
f: Arc<dyn Fn(usize, usize, &str, i64) + Send + Sync>,
) -> Self
pub fn with_progress_fn( self, f: Arc<dyn Fn(usize, usize, &str, i64) + Send + Sync>, ) -> Self
Set a layer progress callback: (current, total, digest, size_bytes).
Sourcepub async fn pull(&self, reference: &str) -> Result<OciImage>
pub async fn pull(&self, reference: &str) -> Result<OciImage>
Pull an image, using the local cache if available.
Returns the loaded OCI image from the store.
Sourcepub async fn force_pull(&self, reference: &str) -> Result<OciImage>
pub async fn force_pull(&self, reference: &str) -> Result<OciImage>
Pull an image, bypassing the local cache.
Sourcepub async fn remove_cached(&self, reference: &str) -> Result<bool>
pub async fn remove_cached(&self, reference: &str) -> Result<bool>
Remove a cached image by reference.
Sourcepub async fn list_cached(&self) -> Result<Vec<String>>
pub async fn list_cached(&self) -> Result<Vec<String>>
List all cached image references.
Trait Implementations§
Source§impl ImageRegistry for ImagePuller
impl ImageRegistry for ImagePuller
Source§fn pull<'life0, 'life1, 'async_trait>(
&'life0 self,
reference: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PulledImage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pull<'life0, 'life1, 'async_trait>(
&'life0 self,
reference: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PulledImage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Pull an image by reference, using local cache when available. Read more
Source§fn force_pull<'life0, 'life1, 'async_trait>(
&'life0 self,
reference: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PulledImage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn force_pull<'life0, 'life1, 'async_trait>(
&'life0 self,
reference: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PulledImage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Pull an image, bypassing any local cache.
Source§fn is_cached<'life0, 'life1, 'async_trait>(
&'life0 self,
reference: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_cached<'life0, 'life1, 'async_trait>(
&'life0 self,
reference: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check whether an image is already available locally.
Auto Trait Implementations§
impl !RefUnwindSafe for ImagePuller
impl !UnwindSafe for ImagePuller
impl Freeze for ImagePuller
impl Send for ImagePuller
impl Sync for ImagePuller
impl Unpin for ImagePuller
impl UnsafeUnpin for ImagePuller
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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