CompositeBuildpackDescriptor

Struct CompositeBuildpackDescriptor 

Source
pub struct CompositeBuildpackDescriptor<BM = GenericMetadata> {
    pub api: BuildpackApi,
    pub buildpack: Buildpack,
    pub order: Vec<Order>,
    pub metadata: BM,
}
Expand description

Data structure for the Buildpack descriptor (buildpack.toml) of a composite buildpack.

Representation of buildpack.toml when the buildpack is a composite buildpack - one that does not implement the Buildpack Interface itself (ie: does not contain /bin/detect and /bin/build executables) but instead references other buildpacks via an order definition.

If support for multiple buildpack types is required, use BuildpackDescriptor instead.

§Example:

use libcnb_data::buildpack::CompositeBuildpackDescriptor;
use libcnb_data::buildpack_id;

let toml_str = r#"
api = "0.10"

[buildpack]
id = "foo/bar"
name = "Bar Buildpack"
version = "0.0.1"
homepage = "https://www.foo.com/bar"
clear-env = false
description = "A buildpack for Foo Bar"
keywords = ["foo"]

[[buildpack.licenses]]
type = "BSD-3-Clause"

[[order]]

[[order.group]]
id = "foo/baz"
version = "0.0.1"
"#;

let buildpack_descriptor =
    toml::from_str::<CompositeBuildpackDescriptor>(toml_str).unwrap();
assert_eq!(buildpack_descriptor.buildpack.id, buildpack_id!("foo/bar"));

Fields§

§api: BuildpackApi§buildpack: Buildpack§order: Vec<Order>§metadata: BM

Trait Implementations§

Source§

impl<BM: Debug> Debug for CompositeBuildpackDescriptor<BM>

Source§

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

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

impl<'de, BM> Deserialize<'de> for CompositeBuildpackDescriptor<BM>
where BM: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,