separate state from rsc

This commit is contained in:
2026-01-01 22:18:08 -05:00
parent 462c0e6416
commit 5da1e9e767
22 changed files with 373 additions and 492 deletions

View File

@@ -48,14 +48,15 @@ pub struct StackBuilder<State, const LEN: usize, Wa: WidgetArrLike<State, LEN, T
_pd: PhantomData<(State, Tag)>,
}
impl<State: StateLike<State>, const LEN: usize, Wa: WidgetArrLike<State, LEN, Tag>, Tag> FnOnce<(&mut State,)>
for StackBuilder<State, LEN, Wa, Tag>
impl<Rsc, const LEN: usize, Wa: WidgetArrLike<Rsc, LEN, Tag>, Tag> WidgetFnTrait<Rsc>
for StackBuilder<Rsc, LEN, Wa, Tag>
{
type Output = Stack;
type Widget = Stack;
extern "rust-call" fn call_once(self, args: (&mut State,)) -> Self::Output {
#[track_caller]
fn run(self, rsc: &mut Rsc) -> Self::Widget {
Stack {
children: self.children.add(args.0).arr.into_iter().collect(),
children: self.children.add(rsc).arr.into_iter().collect(),
size: self.size,
}
}