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
impl ContainerInfo
sourcepub fn from_path<P: AsRef<Path>>(
path: P
) -> Result<ContainerInfo, ContainerInfoError>
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.
sourcepub fn from_reader<R: Read>(r: R) -> Result<ContainerInfo, ContainerInfoError>
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.
sourcepub fn from_string(
contents: String
) -> Result<ContainerInfo, ContainerInfoError>
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.
sourcepub fn to_path<P: AsRef<Path>>(&self, path: P) -> Result<(), ContainerInfoError>
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.
sourcepub fn to_writer<W: Write>(&self, writer: W) -> Result<(), ContainerInfoError>
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
impl Clone for ContainerInfo
source§fn clone(&self) -> ContainerInfo
fn clone(&self) -> ContainerInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ContainerInfo
impl Debug for ContainerInfo
source§impl<'de> Deserialize<'de> for ContainerInfo
impl<'de> Deserialize<'de> for ContainerInfo
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl From<&ContainerInfo> for LocalContainerInfo
impl From<&ContainerInfo> for LocalContainerInfo
source§fn from(container_info: &ContainerInfo) -> Self
fn from(container_info: &ContainerInfo) -> Self
source§impl From<&ContainerInfo> for PackageInfo
impl From<&ContainerInfo> for PackageInfo
source§fn from(container: &ContainerInfo) -> Self
fn from(container: &ContainerInfo) -> Self
source§impl From<ContainerInfo> for LocalContainerInfo
impl From<ContainerInfo> for LocalContainerInfo
source§fn from(container_info: ContainerInfo) -> Self
fn from(container_info: ContainerInfo) -> Self
source§impl From<ContainerInfo> for PackageInfo
impl From<ContainerInfo> for PackageInfo
source§fn from(container: ContainerInfo) -> Self
fn from(container: ContainerInfo) -> Self
Auto Trait Implementations§
impl RefUnwindSafe for ContainerInfo
impl Send for ContainerInfo
impl Sync for ContainerInfo
impl Unpin for ContainerInfo
impl UnwindSafe for ContainerInfo
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request