Struct specifications::package::PackageInfo
source · pub struct PackageInfo {
pub created: DateTime<Utc>,
pub id: Uuid,
pub digest: Option<String>,
pub name: String,
pub version: Version,
pub kind: PackageKind,
pub owners: Vec<String>,
pub description: String,
pub detached: bool,
pub functions: HashMap<String, Function>,
pub types: HashMap<String, Type>,
}
Expand description
The PackageInfo struct, which might be used alongside a Docker container to define its metadata.
Fields§
§created: DateTime<Utc>
The created timestamp of the package.
id: Uuid
The identifier of this package, as an Uuid.
digest: Option<String>
The digest of the resulting image. As long as the image has not been generated, is None.
name: String
The name/programming ID of this package.
version: Version
The version of this package.
kind: PackageKind
The kind of this package.
owners: Vec<String>
The list of owners of this package.
description: String
A short description of the package.
detached: bool
Whether or not the functions in this package run detached (i.e., asynchronous).
functions: HashMap<String, Function>
The functions that this package supports.
types: HashMap<String, Type>
The types that this package adds.
Implementations§
source§impl PackageInfo
impl PackageInfo
sourcepub fn new(
name: String,
version: Version,
kind: PackageKind,
owners: Vec<String>,
description: String,
detached: bool,
functions: HashMap<String, Function>,
types: HashMap<String, Type>,
) -> PackageInfo
pub fn new( name: String, version: Version, kind: PackageKind, owners: Vec<String>, description: String, detached: bool, functions: HashMap<String, Function>, types: HashMap<String, Type>, ) -> PackageInfo
Constructor for the PackageInfo.
Arguments
name
: The name/programming ID of this package.version
: The version of this package.kind
: The kind of this package.owners
: The list of owners of this package.description
: A short description of the package.detached
: Whether or not the functions in this package run detached (i.e., asynchronous).functions
: The functions that this package supports.types
: The types that this package adds.
sourcepub fn from_path(path: PathBuf) -> Result<PackageInfo, PackageInfoError>
pub fn from_path(path: PathBuf) -> Result<PackageInfo, PackageInfoError>
Edited: changed to return appropriate errors. Also added docstring.
Constructor for the PackageInfo that tries to construct it from the file at the given location.
Arguments
path
: The path to load.
Returns
The new PackageInfo upon success, or a PackageInfoError detailling why if it failed.
sourcepub fn from_string(contents: String) -> Result<PackageInfo, PackageInfoError>
pub fn from_string(contents: String) -> Result<PackageInfo, PackageInfoError>
Edited: changed to return appropriate errors. Also added docstring.
Constructor for the PackageInfo that tries to deserialize it.
Arguments
contents
: The string that contains the contents for the PackageInfo.
Returns
The new PackageInfo upon success, or a PackageInfoError detailling why if it failed.
sourcepub fn to_path<P: AsRef<Path>>(&self, path: P) -> Result<(), PackageInfoError>
pub fn to_path<P: AsRef<Path>>(&self, path: P) -> Result<(), PackageInfoError>
Writes the PackageInfo 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 PackageInfoError otherwise.
sourcepub fn to_writer<W: Write>(&self, writer: W) -> Result<(), PackageInfoError>
pub fn to_writer<W: Write>(&self, writer: W) -> Result<(), PackageInfoError>
Writes the PackageInfo 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 PackageInfoError otherwise.
Trait Implementations§
source§impl Clone for PackageInfo
impl Clone for PackageInfo
source§fn clone(&self) -> PackageInfo
fn clone(&self) -> PackageInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PackageInfo
impl Debug for PackageInfo
source§impl<'de> Deserialize<'de> for PackageInfo
impl<'de> Deserialize<'de> for PackageInfo
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 PackageInfo
impl From<&ContainerInfo> for PackageInfo
source§fn from(container: &ContainerInfo) -> Self
fn from(container: &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 Freeze for PackageInfo
impl RefUnwindSafe for PackageInfo
impl Send for PackageInfo
impl Sync for PackageInfo
impl Unpin for PackageInfo
impl UnwindSafe for PackageInfo
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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