pub struct Annotations {
Show 14 fields pub created: Option<String>, pub authors: Option<String>, pub url: Option<String>, pub documentation: Option<String>, pub source: Option<String>, pub version: Option<String>, pub revision: Option<String>, pub vendor: Option<String>, pub licenses: Option<String>, pub ref_name: Option<String>, pub title: Option<String>, pub description: Option<String>, pub base_digest: Option<String>, pub base_name: Option<String>,
}
Expand description

org.opencontainers.image.* annotations

See Pre-Defined Annotation Keys in OCI image spec.

This is designed to use with JSON

use ocipkg::image::annotations::flat::*;

let a = Annotations::from_json(r#"
{
  "org.opencontainers.image.url": "https://github.com/termoshtt/ocipkg"
}
"#).unwrap();
assert_eq!(
    a,
    Annotations {
        url: Some("https://github.com/termoshtt/ocipkg".to_string()),
        ..Default::default()
    }
);

// Dump to JSON
let a = Annotations {
    url: Some("https://github.com/termoshtt/ocipkg".to_string()),
    ..Default::default()
};
assert_eq!(a.to_json().trim(), r#"
{
  "org.opencontainers.image.url": "https://github.com/termoshtt/ocipkg"
}
"#.trim());

Fields

created: Option<String>

org.opencontainers.image.created

date and time on which the image was built (string, date-time as defined by RFC 3339).

authors: Option<String>

org.opencontainers.image.authors

contact details of the people or organization responsible for the image (freeform string)

url: Option<String>

org.opencontainers.image.url

URL to find more information on the image (string)

documentation: Option<String>

org.opencontainers.image.documentation

URL to get documentation on the image (string)

source: Option<String>

org.opencontainers.image.source

URL to get source code for building the image (string)

version: Option<String>

org.opencontainers.image.version

version of the packaged software

revision: Option<String>

org.opencontainers.image.revision

Source control revision identifier for the packaged software.

vendor: Option<String>

org.opencontainers.image.vendor

Name of the distributing entity, organization or individual.

licenses: Option<String>

org.opencontainers.image.licenses

License(s) under which contained software is distributed as an SPDX License Expression.

ref_name: Option<String>

org.opencontainers.image.ref.name

Name of the reference for a target (string).

title: Option<String>

org.opencontainers.image.title

Human-readable title of the image (string)

description: Option<String>

org.opencontainers.image.description

Human-readable description of the software packaged in the image (string)

base_digest: Option<String>

org.opencontainers.image.base.digest

Digest of the image this image is based on (string)

base_name: Option<String>

org.opencontainers.image.base.name

Annotations reference of the image this image is based on (string)

Implementations

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

Converts to this type from the input type.

Converts to this type from the input type.

Creates a value from an iterator. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

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

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.