pub struct ImageStore { /* private fields */ }Expand description
Local OCI blob store.
Implementations§
Source§impl ImageStore
impl ImageStore
pub fn new(data_dir: &Path) -> Result<Self, OciError>
Sourcepub fn put_blob(&self, digest: &str, data: &[u8]) -> Result<PathBuf, OciError>
pub fn put_blob(&self, digest: &str, data: &[u8]) -> Result<PathBuf, OciError>
Write a blob and verify its digest.
Sourcepub fn put_manifest(
&self,
image: &str,
tag: &str,
data: &[u8],
) -> Result<(), OciError>
pub fn put_manifest( &self, image: &str, tag: &str, data: &[u8], ) -> Result<(), OciError>
Save a manifest for an image reference.
Sourcepub fn get_manifest(
&self,
image: &str,
tag: &str,
) -> Result<Option<Vec<u8>>, OciError>
pub fn get_manifest( &self, image: &str, tag: &str, ) -> Result<Option<Vec<u8>>, OciError>
Load a cached manifest. Returns Ok(None) if not cached.
Sourcepub fn list_images(&self) -> Result<Vec<(String, String, usize, u64)>, OciError>
pub fn list_images(&self) -> Result<Vec<(String, String, usize, u64)>, OciError>
List all cached images as (repository, tag, layers, size_bytes) tuples.
Sourcepub fn parse_manifest(data: &[u8]) -> Result<ImageManifest, OciError>
pub fn parse_manifest(data: &[u8]) -> Result<ImageManifest, OciError>
Parse an OCI/Docker manifest JSON.
Sourcepub fn parse_config(data: &[u8]) -> Result<ImageConfig, OciError>
pub fn parse_config(data: &[u8]) -> Result<ImageConfig, OciError>
Parse image config JSON to extract entrypoint, cmd, env, etc.
Sourcepub fn extract_layers(
&self,
manifest: &ImageManifest,
target: &Path,
) -> Result<(), OciError>
pub fn extract_layers( &self, manifest: &ImageManifest, target: &Path, ) -> Result<(), OciError>
Extract all layers of an image into a target directory (for rootfs preparation).
Auto Trait Implementations§
impl Freeze for ImageStore
impl RefUnwindSafe for ImageStore
impl Send for ImageStore
impl Sync for ImageStore
impl Unpin for ImageStore
impl UnsafeUnpin for ImageStore
impl UnwindSafe for ImageStore
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
Mutably borrows from an owned value. Read more