Struct libcnb_data::buildpack::SingleBuildpackDescriptor
source · [−]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: BuildpackApi
buildpack: Buildpack
stacks: Vec<Stack>
metadata: BM
Trait Implementations
sourceimpl<BM: Debug> Debug for SingleBuildpackDescriptor<BM>
impl<BM: Debug> Debug for SingleBuildpackDescriptor<BM>
sourceimpl<'de, BM> Deserialize<'de> for SingleBuildpackDescriptor<BM> where
BM: Deserialize<'de>,
impl<'de, BM> Deserialize<'de> for SingleBuildpackDescriptor<BM> where
BM: Deserialize<'de>,
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<BM> RefUnwindSafe for SingleBuildpackDescriptor<BM> where
BM: RefUnwindSafe,
impl<BM> Send for SingleBuildpackDescriptor<BM> where
BM: Send,
impl<BM> Sync for SingleBuildpackDescriptor<BM> where
BM: Sync,
impl<BM> Unpin for SingleBuildpackDescriptor<BM> where
BM: Unpin,
impl<BM> UnwindSafe for SingleBuildpackDescriptor<BM> where
BM: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more