Struct gpui2::AsyncAppContext
source · pub struct AsyncAppContext { /* private fields */ }
Implementations§
source§impl AsyncAppContext
impl 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 AsyncAppContext
impl Clone for AsyncAppContext
source§fn clone(&self) -> AsyncAppContext
fn clone(&self) -> AsyncAppContext
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 AsyncAppContext
impl Context for AsyncAppContext
type Result<T> = Result<T, Error>
fn build_model<T>( &mut self, build_model: impl FnOnce(&mut ModelContext<'_, T>) -> T ) -> Self::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 ) -> Self::Result<R>
fn read_model<T, R>( &self, handle: &Model<T>, callback: impl FnOnce(&T, &AppContext) -> R ) -> Self::Result<R>where T: 'static,
fn update_window<T, F>(&mut self, window: AnyWindowHandle, f: F) -> Result<T>where F: FnOnce(AnyView, &mut WindowContext<'_>) -> T,
fn read_window<T, R>( &self, window: &WindowHandle<T>, read: impl FnOnce(View<T>, &AppContext) -> R ) -> Result<R>where T: 'static,
Auto Trait Implementations§
impl !RefUnwindSafe for AsyncAppContext
impl !Send for AsyncAppContext
impl !Sync for AsyncAppContext
impl Unpin for AsyncAppContext
impl !UnwindSafe for AsyncAppContext
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