Get collab2 green

This commit is contained in:
Mikayla 2023-11-03 18:01:06 -07:00
parent c529343ba1
commit e1525e2b47
No known key found for this signature in database
265 changed files with 64477 additions and 40 deletions

View file

@ -1364,6 +1364,18 @@ impl Context for WindowContext<'_> {
window.update(self.app, update)
}
}
fn read_model<T, R>(
&self,
handle: &Model<T>,
read: impl FnOnce(&T, &AppContext) -> R,
) -> Self::Result<R>
where
T: 'static,
{
let entity = self.entities.read(handle);
read(&*entity, &*self.app)
}
}
impl VisualContext for WindowContext<'_> {
@ -2009,6 +2021,17 @@ impl<V> Context for ViewContext<'_, V> {
{
self.window_cx.update_window(window, update)
}
fn read_model<T, R>(
&self,
handle: &Model<T>,
read: impl FnOnce(&T, &AppContext) -> R,
) -> Self::Result<R>
where
T: 'static,
{
self.window_cx.read_model(handle, read)
}
}
impl<V: 'static> VisualContext for ViewContext<'_, V> {