New architecture
This commit is contained in:
parent
e4b3424ba6
commit
907a4962c5
61 changed files with 2742 additions and 3100 deletions
25
src/to_artifact.rs
Normal file
25
src/to_artifact.rs
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue