Struct oci_client::manifest::OciImageManifest

source ·
pub struct OciImageManifest {
    pub schema_version: u8,
    pub media_type: Option<String>,
    pub config: OciDescriptor,
    pub layers: Vec<OciDescriptor>,
    pub artifact_type: Option<String>,
    pub annotations: Option<BTreeMap<String, String>>,
}
Expand description

The OCI image manifest describes an OCI image.

It is part of the OCI specification, and is defined here

Fields§

§schema_version: u8

This is a schema version.

The specification does not specify the width of this integer. However, the only version allowed by the specification is 2. So we have made this a u8.

§media_type: Option<String>

This is an optional media type describing this manifest.

This property SHOULD be used and remain compatible with earlier versions of this specification and with other similar external formats.

§config: OciDescriptor

The image configuration.

This object is required.

§layers: Vec<OciDescriptor>

The OCI image layers

The specification is unclear whether this is required. We have left it required, assuming an empty vector can be used if necessary.

§artifact_type: Option<String>

The OCI artifact type

This OPTIONAL property contains the type of an artifact when the manifest is used for an artifact. This MUST be set when config.mediaType is set to the empty value. If defined, the value MUST comply with RFC 6838, including the naming requirements in its section 4.2, and MAY be registered with IANA. Implementations storing or copying image manifests MUST NOT error on encountering an artifactType that is unknown to the implementation.

Introduced in OCI Image Format spec v1.1

§annotations: Option<BTreeMap<String, String>>

The annotations for this manifest

The specification says “If there are no annotations then this property MUST either be absent or be an empty map.” TO accomodate either, this is optional.

Implementations§

source§

impl OciImageManifest

source

pub fn build( layers: &[ImageLayer], config: &Config, annotations: Option<BTreeMap<String, String>>, ) -> Self

Create a new OciImageManifest using the given parameters

This can be useful to create an OCI Image Manifest with custom annotations.

Trait Implementations§

source§

impl Clone for OciImageManifest

source§

fn clone(&self) -> OciImageManifest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for OciImageManifest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for OciImageManifest

source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for OciImageManifest

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for OciImageManifest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<OciImageManifest> for OciManifest

source§

fn from(m: OciImageManifest) -> Self

Converts to this type from the input type.
source§

impl Serialize for OciImageManifest

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromBase64 for T
where T: for<'de> Deserialize<'de>,

source§

fn from_base64<Input>(raw: &Input) -> Result<T, Error>
where Input: AsRef<[u8]> + ?Sized,

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<C> SignWithKey<String> for C
where C: ToBase64,

source§

impl<T> ToBase64 for T
where T: Serialize,

source§

fn to_base64(&self) -> Result<Cow<'_, str>, Error>

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,