pub enum MediaType {
Show 16 variants
OciManifest,
OciIndex,
OciConfig,
OciLayerGzip,
OciLayer,
OciLayerZstd,
OciLayerNondistributable,
OciLayerNondistributableGzip,
OciLayerNondistributableZstd,
OciEmptyJson,
DockerManifest,
DockerManifestList,
DockerConfig,
DockerLayerGzip,
DockerForeignLayer,
Other(String),
}Expand description
Known media types for OCI and Docker images.
Variants§
OciManifest
OCI image manifest.
OciIndex
OCI image index (multi-arch).
OciConfig
OCI image config.
OciLayerGzip
OCI layer (gzip compressed).
OciLayer
OCI layer (uncompressed).
OciLayerZstd
OCI layer (zstd compressed).
OciLayerNondistributable
OCI non-distributable layer (uncompressed, deprecated).
OciLayerNondistributableGzip
OCI non-distributable layer (gzip, deprecated).
OciLayerNondistributableZstd
OCI non-distributable layer (zstd, deprecated).
OciEmptyJson
OCI empty/scratch config descriptor.
DockerManifest
Docker v2 schema 2 manifest.
DockerManifestList
Docker manifest list.
DockerConfig
Docker container config.
DockerLayerGzip
Docker layer (gzip compressed).
DockerForeignLayer
Docker foreign/non-distributable layer.
Other(String)
Unknown or custom media type.
Implementations§
Source§impl MediaType
impl MediaType
Sourcepub fn is_manifest(&self) -> bool
pub fn is_manifest(&self) -> bool
Returns true if this is a manifest type (single image).
Sourcepub fn is_index(&self) -> bool
pub fn is_index(&self) -> bool
Returns true if this is an index/manifest list type (multi-arch).
Sourcepub fn is_nondistributable(&self) -> bool
pub fn is_nondistributable(&self) -> bool
Returns true if this is a non-distributable/foreign layer type.
Sourcepub fn to_oci(&self) -> MediaType
pub fn to_oci(&self) -> MediaType
Returns the OCI equivalent of this media type, if applicable.
Sourcepub fn to_docker(&self) -> MediaType
pub fn to_docker(&self) -> MediaType
Returns the Docker equivalent of this media type, if applicable.
Note: This only changes the media type string. It does NOT transform the actual content. For layers with incompatible compression formats (uncompressed, zstd), this will return the same media type unchanged since Docker does not support those formats.
Sourcepub fn is_docker_compatible(&self) -> bool
pub fn is_docker_compatible(&self) -> bool
Returns true if this media type can be safely converted to Docker format.
Returns false for OCI-specific compression formats that Docker doesn’t support.