checkpoint
This commit is contained in:
parent
f569628088
commit
43eb7f28d1
22 changed files with 591 additions and 1307 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue