oci_spec::image

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