Struct oci_spec::image::PlatformBuilder

source ·
pub struct PlatformBuilder { /* private fields */ }
Expand description

Builder for Platform.

Implementations§

source§

impl PlatformBuilder

source

pub fn architecture<VALUE: Into<Arch>>(self, value: VALUE) -> Self

This REQUIRED property specifies the CPU architecture. Image indexes SHOULD use, and implementations SHOULD understand, values listed in the Go Language document for GOARCH.

source

pub fn os<VALUE: Into<Os>>(self, value: VALUE) -> Self

This REQUIRED property specifies the operating system. Image indexes SHOULD use, and implementations SHOULD understand, values listed in the Go Language document for GOOS.

source

pub fn os_version<VALUE: Into<String>>(self, value: VALUE) -> Self

This OPTIONAL property specifies the version of the operating system targeted by the referenced blob. Implementations MAY refuse to use manifests where os.version is not known to work with the host OS version. Valid values are implementation-defined. e.g. 10.0.14393.1066 on windows.

source

pub fn os_features<VALUE: Into<Vec<String>>>(self, value: VALUE) -> Self

This OPTIONAL property specifies an array of strings, each specifying a mandatory OS feature. When os is windows, image indexes SHOULD use, and implementations SHOULD understand the following values:

  • win32k: image requires win32k.sys on the host (Note: win32k.sys is missing on Nano Server)

When os is not windows, values are implementation-defined and SHOULD be submitted to this specification for standardization.

source

pub fn variant<VALUE: Into<String>>(self, value: VALUE) -> Self

This OPTIONAL property specifies the variant of the CPU. Image indexes SHOULD use, and implementations SHOULD understand, variant values listed in the [Platform Variants] (https://github.com/opencontainers/image-spec/blob/main/image-index.md#platform-variants) table.

source

pub fn features<VALUE: Into<Vec<String>>>(self, value: VALUE) -> Self

This property is RESERVED for future versions of the specification.

source

pub fn build(self) -> Result<Platform, OciSpecError>

Builds a new Platform.

§Errors

If a required field has not been initialized.

Trait Implementations§

source§

impl Default for PlatformBuilder

source§

fn default() -> Self

Returns the “default value” for a type. 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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.