Struct specifications::container::ContainerInfo

source ·
pub struct ContainerInfo {
Show 15 fields pub name: String, pub version: Version, pub kind: PackageKind, pub owners: Option<Vec<String>>, pub description: Option<String>, pub actions: HashMap<String, Action>, pub entrypoint: Entrypoint, pub types: Option<HashMap<String, Type>>, pub base: Option<String>, pub dependencies: Option<Vec<String>>, pub environment: Option<HashMap<String, String>>, pub files: Option<Vec<String>>, pub initialize: Option<Vec<String>>, pub install: Option<Vec<String>>, pub unpack: Option<Vec<String>>,
}
Expand description

Specifies the contents of a container info YAML file. Note that this is only the file the user creates.

Fields§

§name: String

The name/programming ID of this package.

§version: Version

The version of this package.

§kind: PackageKind

The kind of this package.

§owners: Option<Vec<String>>

The list of owners of this package.

§description: Option<String>

A short description of the package.

§actions: HashMap<String, Action>

The functions that this package supports.

§entrypoint: Entrypoint

The entrypoint of the image

§types: Option<HashMap<String, Type>>

The types that this package adds.

§base: Option<String>

The base image to use for the package image.

§dependencies: Option<Vec<String>>

The dependencies, as install commands for sudo apt-get install -y <…>

§environment: Option<HashMap<String, String>>

Any environment variables that the user wants to be set

§files: Option<Vec<String>>

The list of additional files to copy to the image

§initialize: Option<Vec<String>>

An extra script to run to initialize the working directory

§install: Option<Vec<String>>

An extra set of commands that will be run before the workspace is copied over. Useful for non-standard general dependencies.

§unpack: Option<Vec<String>>

An extra set of commands that will be run after the workspace is copied over. Useful for preprocessing or unpacking things.

Implementations§

source§

impl ContainerInfo

source

pub fn from_path<P: AsRef<Path>>( path: P, ) -> Result<ContainerInfo, ContainerInfoError>

Edited: now returning ContainerInfoErrors.

Returns a ContainerInfo by constructing it from the file at the given path.

Generic types

  • P: The Path-like type of the given target location.

Arguments

  • path: The path to the container info file.

Returns
The newly constructed ContainerInfo instance on success, or a ContainerInfoError upon failure.

source

pub fn from_reader<R: Read>(r: R) -> Result<ContainerInfo, ContainerInfoError>

Edited: now returning ContainerInfoErrors.

Returns a ContainerInfo by constructing it from the given Reader with YAML text.

Arguments

  • r: The reader with the contents of the raw YAML file.

Returns
The newly constructed ContainerInfo instance on success, or a ContainerInfoError upon failure.

source

pub fn from_string( contents: String, ) -> Result<ContainerInfo, ContainerInfoError>

Edited: now returning ContainerInfoErrors.

Returns a ContainerInfo by constructing it from the given string of YAML text.

Arguments

  • contents: The text contents of a raw YAML file.

Returns
The newly constructed ContainerInfo instance on success, or a ContainerInfoError upon failure.

source

pub fn to_path<P: AsRef<Path>>(&self, path: P) -> Result<(), ContainerInfoError>

Writes the ContainerInfo to the given location.

Generic types

  • P: The Path-like type of the given target location.

Arguments

  • path: The target location to write to the LocalContainerInfo to.

Returns
Nothing on success, or a ContainerInfoError otherwise.

source

pub fn to_writer<W: Write>(&self, writer: W) -> Result<(), ContainerInfoError>

Writes the ContainerInfo to the given writer.

Generic types

  • W: The type of the writer, which implements Write.

Arguments

  • writer: The writer to write to. Will be consumed.

Returns
Nothing on success, or a ContainerInfoError otherwise.

Trait Implementations§

source§

impl Clone for ContainerInfo

source§

fn clone(&self) -> ContainerInfo

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 ContainerInfo

source§

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

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

impl<'de> Deserialize<'de> for ContainerInfo

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 From<&ContainerInfo> for LocalContainerInfo

source§

fn from(container_info: &ContainerInfo) -> Self

Converts to this type from the input type.
source§

impl From<&ContainerInfo> for PackageInfo

source§

fn from(container: &ContainerInfo) -> Self

Converts to this type from the input type.
source§

impl From<ContainerInfo> for LocalContainerInfo

source§

fn from(container_info: ContainerInfo) -> Self

Converts to this type from the input type.
source§

impl From<ContainerInfo> for PackageInfo

source§

fn from(container: ContainerInfo) -> Self

Converts to this type from the input type.
source§

impl Serialize for ContainerInfo

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> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

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

source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T