Struct oci_spec::image::ImageIndex [−][src]
pub struct ImageIndex {
pub schema_version: u32,
pub media_type: Option<String>,
pub manifests: Vec<Descriptor>,
pub annotations: Option<HashMap<String, String>>,
}Expand description
The image index is a higher-level manifest which points to specific image manifests, ideal for one or more platforms. While the use of an image index is OPTIONAL for image providers, image consumers SHOULD be prepared to process them.
Fields
schema_version: u32This REQUIRED property specifies the image manifest schema version. For this version of the specification, this MUST be 2 to ensure backward compatibility with older versions of Docker. The value of this field will not change. This field MAY be removed in a future version of the specification.
media_type: Option<String>This property is reserved for use, to maintain compatibility. When used, this field contains the media type of this document, which differs from the descriptor use of mediaType.
manifests: Vec<Descriptor>This REQUIRED property contains a list of manifests for specific platforms. While this property MUST be present, the size of the array MAY be zero.
annotations: Option<HashMap<String, String>>This OPTIONAL property contains arbitrary metadata for the image index. This OPTIONAL property MUST use the annotation rules.
Implementations
Attempts to load an image index.
Errors
This function will return an OciSpecError::Io if the image index does not exist or an OciSpecError::SerDe if it is invalid.
Example
use oci_spec::image::ImageIndex;
let image_index = ImageIndex::load("my-index.json").unwrap();Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl RefUnwindSafe for ImageIndex
impl Send for ImageIndex
impl Sync for ImageIndex
impl Unpin for ImageIndex
impl UnwindSafe for ImageIndex
Blanket Implementations
Mutably borrows from an owned value. Read more