pub struct Registry { /* private fields */ }Expand description
OCI registry client with platform resolution, caching, and progress reporting.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn new(platform: Platform, cache: GlobalCache) -> ImageResult<Self>
pub fn new(platform: Platform, cache: GlobalCache) -> ImageResult<Self>
Create a registry client with anonymous authentication and default TLS settings.
Sourcepub fn builder(platform: Platform, cache: GlobalCache) -> RegistryBuilder
pub fn builder(platform: Platform, cache: GlobalCache) -> RegistryBuilder
Create a builder for configuring auth, TLS, and other registry options.
Sourcepub fn pull_cached(
cache: &GlobalCache,
reference: &Reference,
options: &PullOptions,
) -> ImageResult<Option<(PullResult, CachedImageMetadata)>>
pub fn pull_cached( cache: &GlobalCache, reference: &Reference, options: &PullOptions, ) -> ImageResult<Option<(PullResult, CachedImageMetadata)>>
Resolve a pull directly from the on-disk cache without building a registry client.
Sourcepub async fn pull(
&self,
reference: &Reference,
options: &PullOptions,
) -> ImageResult<PullResult>
pub async fn pull( &self, reference: &Reference, options: &PullOptions, ) -> ImageResult<PullResult>
Pull an image. Downloads blobs and materializes EROFS layers concurrently.
Sourcepub async fn materialize_cached_layers(
&self,
reference: &Reference,
metadata: &CachedImageMetadata,
force: bool,
) -> ImageResult<PullResult>
pub async fn materialize_cached_layers( &self, reference: &Reference, metadata: &CachedImageMetadata, force: bool, ) -> ImageResult<PullResult>
Materialize layers that have already been staged into the cache.
This is used by archive import: layer blobs are written to the cache at their descriptor digest first, then the normal EROFS/fsmeta/VMDK materialization path can run without contacting a registry.
Sourcepub fn pull_with_progress(
&self,
reference: &Reference,
options: &PullOptions,
) -> (PullProgressHandle, JoinHandle<ImageResult<PullResult>>)
pub fn pull_with_progress( &self, reference: &Reference, options: &PullOptions, ) -> (PullProgressHandle, JoinHandle<ImageResult<PullResult>>)
Pull with progress reporting.
Creates a progress channel internally and returns both the receiver handle and the spawned pull task.
Sourcepub fn pull_with_sender(
&self,
reference: &Reference,
options: &PullOptions,
sender: PullProgressSender,
) -> JoinHandle<ImageResult<PullResult>>
pub fn pull_with_sender( &self, reference: &Reference, options: &PullOptions, sender: PullProgressSender, ) -> JoinHandle<ImageResult<PullResult>>
Pull with an externally-provided progress sender.
Use progress_channel() to create the
channel, keep the PullProgressHandle receiver, and pass the
PullProgressSender here.