New architecture

This commit is contained in:
Adrian Heine 2019-12-26 20:50:23 +01:00
parent e4b3424ba6
commit 907a4962c5
61 changed files with 2742 additions and 3100 deletions

25
src/to_artifact.rs Normal file
View file

@ -0,0 +1,25 @@
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> {
type Artifact = Option<T::Artifact>;
}
impl<T: Resource> ToArtifact for T {
type Artifact = T::Artifact;
}