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

source

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

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.

source

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.

source

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.

source

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

source§

fn clone(&self) -> PackageInfo

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 PackageInfo

source§

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

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

impl<'de> Deserialize<'de> for PackageInfo

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 PackageInfo

source§

fn from(container: &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 PackageInfo

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