checkpoint

This commit is contained in:
Mikayla 2023-11-08 23:16:04 -08:00
parent f569628088
commit 43eb7f28d1
No known key found for this signature in database
22 changed files with 591 additions and 1307 deletions

View file

@ -67,11 +67,14 @@ impl Context for AsyncAppContext {
lock.update_window(window, f)
}
fn read_window<R>(
fn read_window<T, R>(
&self,
window: &AnyWindowHandle,
read: impl FnOnce(AnyView, &AppContext) -> R,
) -> Result<R> {
window: &WindowHandle<T>,
read: impl FnOnce(&T, &AppContext) -> R,
) -> Result<R>
where
T: 'static,
{
let app = self.app.upgrade().context("app was released")?;
let lock = app.borrow();
lock.read_window(window, read)
@ -261,11 +264,14 @@ impl Context for AsyncWindowContext {
self.app.read_model(handle, read)
}
fn read_window<R>(
fn read_window<T, R>(
&self,
window: &AnyWindowHandle,
read: impl FnOnce(AnyView, &AppContext) -> R,
) -> Result<R> {
window: &WindowHandle<T>,
read: impl FnOnce(&T, &AppContext) -> R,
) -> Result<R>
where
T: 'static,
{
self.app.read_window(window, read)
}
}