pub struct SingleBuildpackDescriptor<BM> {
    pub api: BuildpackApi,
    pub buildpack: Buildpack,
    pub stacks: Vec<Stack>,
    pub metadata: BM,
}
Expand description

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

Representation of buildpack.toml when the buildpack is a single buildpack that implements the Buildpack Interface (ie: not a meta-buildpack).

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

Example:

use libcnb_data::buildpack_id;
use libcnb_data::buildpack::{SingleBuildpackDescriptor, Stack};

let toml_str = r#"
api = "0.8"

[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"

[[stacks]]
id = "*"
"#;

let buildpack_descriptor = toml::from_str::<SingleBuildpackDescriptor<Option<toml::value::Table>>>(toml_str).unwrap();
assert_eq!(buildpack_descriptor.buildpack.id, buildpack_id!("foo/bar"));
assert_eq!(buildpack_descriptor.stacks, vec![Stack::Any]);

Fields

api: BuildpackApibuildpack: Buildpackstacks: Vec<Stack>metadata: BM

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.