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: u32

This 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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

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 !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.