Struct gpui2::AsyncWindowContext
source · pub struct AsyncWindowContext { /* private fields */ }
Implementations§
source§impl AsyncWindowContext
impl AsyncWindowContext
pub fn window_handle(&self) -> AnyWindowHandle
pub fn update<R>( &mut self, update: impl FnOnce(AnyView, &mut WindowContext<'_>) -> R ) -> Result<R>
pub fn on_next_frame( &mut self, f: impl FnOnce(&mut WindowContext<'_>) + 'static )
pub fn read_global<G: 'static, R>( &mut self, read: impl FnOnce(&G, &WindowContext<'_>) -> R ) -> Result<R>
pub fn update_global<G, R>( &mut self, update: impl FnOnce(&mut G, &mut WindowContext<'_>) -> R ) -> Result<R>where G: 'static,
pub fn spawn<Fut, R>( &self, f: impl FnOnce(AsyncWindowContext) -> Fut ) -> Task<R> ⓘwhere Fut: Future<Output = R> + 'static, R: 'static,
Methods from Deref<Target = AsyncAppContext>§
pub fn refresh(&mut self) -> Result<()>
pub fn background_executor(&self) -> &BackgroundExecutor
pub fn foreground_executor(&self) -> &ForegroundExecutor
pub fn update<R>(&self, f: impl FnOnce(&mut AppContext) -> R) -> Result<R>
pub fn open_window<V>( &self, options: WindowOptions, build_root_view: impl FnOnce(&mut WindowContext<'_>) -> View<V> ) -> Result<WindowHandle<V>>where V: 'static + Render,
pub fn spawn<Fut, R>(&self, f: impl FnOnce(AsyncAppContext) -> Fut) -> Task<R> ⓘwhere Fut: Future<Output = R> + 'static, R: 'static,
pub fn has_global<G: 'static>(&self) -> Result<bool>
pub fn read_global<G: 'static, R>( &self, read: impl FnOnce(&G, &AppContext) -> R ) -> Result<R>
pub fn try_read_global<G: 'static, R>( &self, read: impl FnOnce(&G, &AppContext) -> R ) -> Option<R>
pub fn update_global<G: 'static, R>( &mut self, update: impl FnOnce(&mut G, &mut AppContext) -> R ) -> Result<R>
Trait Implementations§
source§impl Clone for AsyncWindowContext
impl Clone for AsyncWindowContext
source§fn clone(&self) -> AsyncWindowContext
fn clone(&self) -> AsyncWindowContext
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Context for AsyncWindowContext
impl Context for AsyncWindowContext
type Result<T> = Result<T, Error>
fn build_model<T>( &mut self, build_model: impl FnOnce(&mut ModelContext<'_, T>) -> T ) -> Result<Model<T>>where T: 'static,
fn update_model<T: 'static, R>( &mut self, handle: &Model<T>, update: impl FnOnce(&mut T, &mut ModelContext<'_, T>) -> R ) -> Result<R>
fn update_window<T, F>( &mut self, window: AnyWindowHandle, update: F ) -> Result<T>where F: FnOnce(AnyView, &mut WindowContext<'_>) -> T,
fn read_model<T, R>( &self, handle: &Model<T>, read: impl FnOnce(&T, &AppContext) -> R ) -> Self::Result<R>where T: 'static,
fn read_window<T, R>( &self, window: &WindowHandle<T>, read: impl FnOnce(View<T>, &AppContext) -> R ) -> Result<R>where T: 'static,
source§impl Deref for AsyncWindowContext
impl Deref for AsyncWindowContext
source§impl DerefMut for AsyncWindowContext
impl DerefMut for AsyncWindowContext
source§impl VisualContext for AsyncWindowContext
impl VisualContext for AsyncWindowContext
fn build_view<V>( &mut self, build_view_state: impl FnOnce(&mut ViewContext<'_, V>) -> V ) -> Self::Result<View<V>>where V: 'static + Render,
fn update_view<V: 'static, R>( &mut self, view: &View<V>, update: impl FnOnce(&mut V, &mut ViewContext<'_, V>) -> R ) -> Self::Result<R>
fn replace_root_view<V>( &mut self, build_view: impl FnOnce(&mut ViewContext<'_, V>) -> V ) -> Self::Result<View<V>>where V: 'static + Render,
fn focus_view<V>(&mut self, view: &View<V>) -> Self::Result<()>where V: FocusableView,
fn dismiss_view<V>(&mut self, view: &View<V>) -> Self::Result<()>where V: ManagedView,
Auto Trait Implementations§
impl !RefUnwindSafe for AsyncWindowContext
impl !Send for AsyncWindowContext
impl !Sync for AsyncWindowContext
impl Unpin for AsyncWindowContext
impl !UnwindSafe for AsyncWindowContext
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more