handles (tuple)

This commit is contained in:
iris committed 2025-12-11 07:30:59 -05:00
1 parent 36668c82f4
commit 2dad409300
5 files changed
+36 -40

No files matched your search

+3 -1
View File
@@ -26,6 +26,8 @@ pub struct WidgetView<W: ?Sized = dyn Widget> {
ty: *const W,
}
pub type WidgetHandles<W> = (WidgetHandle<W>, WidgetView<W>);
impl<W: Widget + ?Sized + Unsize<dyn Widget>> WidgetHandle<W> {
pub fn any(self) -> WidgetHandle<dyn Widget> {
self
@@ -60,7 +62,7 @@ impl<W: ?Sized> WidgetHandle<W> {
WidgetView { ty, id }
}
pub fn handles(self) -> (Self, WidgetView<W>) {
pub fn handles(self) -> WidgetHandles<W> {
let weak = self.weak();
(self, weak)
}