feat(core): compose effect collections

Support Vec<T: IntoEffect> and [T; N] batches so dynamic reusable partial updates compose inside the existing effect model without a broad IntoIterator blanket impl.

req: canonical_authoring/003
This commit is contained in:
slhx agent
2026-06-12 14:36:58 +02:00
parent f343e8aaee
commit 8f96169b03
5 changed files with 44 additions and 3 deletions
+16
View File
@@ -850,6 +850,22 @@ impl<T: IntoEffect> IntoEffect for Option<T> {
}
}
impl<T: IntoEffect> IntoEffect for Vec<T> {
fn append_to(self, ops: &mut Vec<Effect>) {
for effect in self {
effect.append_to(ops);
}
}
}
impl<T: IntoEffect, const N: usize> IntoEffect for [T; N] {
fn append_to(self, ops: &mut Vec<Effect>) {
for effect in self {
effect.append_to(ops);
}
}
}
macro_rules! impl_tuple_into_effect {
($($name:ident $idx:tt),+) => {
impl<$($name),+> IntoEffect for ($($name,)+)