separate state from rsc
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user