better global state structure?
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use std::{marker::Unsize, mem::MaybeUninit, ops::CoerceUnsized, sync::mpsc::Sender};
|
||||
|
||||
use crate::{
|
||||
Widget,
|
||||
HasUi, Widget,
|
||||
util::{RefCounter, SlotId},
|
||||
};
|
||||
|
||||
@@ -143,3 +143,11 @@ impl<W> std::fmt::Debug for WidgetHandle<W> {
|
||||
self.id.fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, W: Widget + 'a, State: HasUi> FnOnce<(&'a mut State,)> for WidgetRef<W> {
|
||||
type Output = &'a mut W;
|
||||
|
||||
extern "rust-call" fn call_once(self, args: (&'a mut State,)) -> Self::Output {
|
||||
&mut args.0.ui_mut()[self]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user