A library for writing host-specific, single-binary configuration management and deployment tools
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
608 B

use crate::resources::Resource;
pub trait ToArtifact {
type Artifact;
}
macro_rules! to_artifact {
( $($name:ident)* ) => (
#[allow(non_snake_case)]
impl<$($name: Resource,)*> ToArtifact for ($($name,)*)
{
type Artifact = ($($name::Artifact,)*);
}
);
}
for_each_tuple!(to_artifact);
impl<T: Resource> ToArtifact for Option<T> {
// FIXME: https://github.com/rust-lang/rust-clippy/issues/2843
#![allow(clippy::use_self)]
type Artifact = Option<T::Artifact>;
}
impl<T: Resource> ToArtifact for T {
type Artifact = <Self as Resource>::Artifact;
}