pub enum ImageIndex {
Oci(OciIndex),
Docker(DockerManifestList),
}Expand description
A unified index type that can represent either OCI or Docker formats.
Variants§
Oci(OciIndex)
Docker(DockerManifestList)
Implementations§
Source§impl ImageIndex
impl ImageIndex
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self>
pub fn from_bytes(data: &[u8]) -> Result<Self>
Parses an image index from JSON bytes, auto-detecting the format.
Detection is based on the mediaType field:
- Docker manifest list:
application/vnd.docker.distribution.manifest.list.v2+json - OCI index:
application/vnd.oci.image.index.v1+json
Returns an error if mediaType is missing or unrecognized.
Sourcepub fn manifests(&self) -> &[Descriptor]
pub fn manifests(&self) -> &[Descriptor]
Returns the manifest descriptors.
Sourcepub fn media_type(&self) -> MediaType
pub fn media_type(&self) -> MediaType
Returns the media type of this index.
Sourcepub fn find_platform(
&self,
arch: &str,
os: &str,
variant: Option<&str>,
) -> Option<&Descriptor>
pub fn find_platform( &self, arch: &str, os: &str, variant: Option<&str>, ) -> Option<&Descriptor>
Finds a manifest matching the given platform.
Trait Implementations§
Source§impl Clone for ImageIndex
impl Clone for ImageIndex
Source§fn clone(&self) -> ImageIndex
fn clone(&self) -> ImageIndex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ImageIndex
impl Debug for ImageIndex
Source§impl PartialEq for ImageIndex
impl PartialEq for ImageIndex
impl Eq for ImageIndex
impl StructuralPartialEq for ImageIndex
Auto Trait Implementations§
impl Freeze for ImageIndex
impl RefUnwindSafe for ImageIndex
impl Send for ImageIndex
impl Sync for ImageIndex
impl Unpin for ImageIndex
impl UnsafeUnpin for ImageIndex
impl UnwindSafe for ImageIndex
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