use super::*; type Init<'s> = (&'s mut Window, Load); pub trait InitArgs<'s> { fn get(self) -> Init<'s>; } impl<'s> InitArgs<'s> for &'s mut Window { fn get(self) -> Init<'s> { (self, vec![]) } } impl<'s, I: LoadArgs> InitArgs<'s> for (&'s mut Window, I) { fn get(self) -> Init<'s> { let (w, i) = self; (w, i.get()) } } type Load = Vec; pub trait LoadArgs { fn get(self) -> Load; } impl LoadArgs for &str { fn get(self) -> Load { vec![Arc::from(self)] } } impl, const N: usize> LoadArgs for [T; N] { fn get(self) -> Load { self.into_iter().map(|a| a.into()).collect() } } type Compile = Box<[Str]>; pub trait CompileArgs { fn get(self) -> Compile; } impl, A2: Into> CompileArgs for (A1, A2) { fn get(self) -> Compile { let (a1, a2) = self; [a1.into(), a2.into()].into() } } impl, A2: Into, A3: Into> CompileArgs for (A1, A2, A3) { fn get(self) -> Compile { let (a1, a2, a3) = self; [a1.into(), a2.into(), a3.into()].into() } } impl, A2: Into, A3: Into, A4: Into> CompileArgs for (A1, A2, A3, A4) { fn get(self) -> Compile { let (a1, a2, a3, a4) = self; [a1.into(), a2.into(), a3.into(), a4.into()].into() } } impl, A2: Into, A3: Into, A4: Into, A5: Into> CompileArgs for (A1, A2, A3, A4, A5) { fn get(self) -> Compile { let (a1, a2, a3, a4, a5) = self; [a1.into(), a2.into(), a3.into(), a4.into(), a5.into()].into() } } impl CompileArgs for [InlineShader; N] { fn get(self) -> Compile { self.into_iter().map(|a| a.into()).collect_box() } }