pub struct AppContext { /* private fields */ }Expand description
Weak access to the application that owns a node. Cloning this context does not keep an application active. This context stays local and provides no dependency lookup.
Implementations§
Source§impl AppContext
impl AppContext
Sourcepub fn async_scope(&self) -> Result<AsyncScope, AsyncError>
pub fn async_scope(&self) -> Result<AsyncScope, AsyncError>
Application lifetime, independent of individual mounted views.
Sourcepub fn set_task_error_sink(
&self,
sink: impl Fn(String) + 'static,
) -> Result<(), AsyncError>
pub fn set_task_error_sink( &self, sink: impl Fn(String) + 'static, ) -> Result<(), AsyncError>
Observe unhandled task panics on the UI thread, including dropped controls. Reporting continues while managed shutdown retains the application. The sink must not touch detached UI state once the phase is Closing.
Sourcepub fn id(&self) -> Option<u64>
pub fn id(&self) -> Option<u64>
Process-local identity of this application instance while retained.
Sourcepub fn closed(&self) -> AppClosed ⓘ
pub fn closed(&self) -> AppClosed ⓘ
Observe disposal completion without driving cleanup. The host’s wake scheduler keeps cleanup progressing even when this future is not polled.
Sourcepub fn target(&self) -> Result<TargetInfo, AsyncError>
pub fn target(&self) -> Result<TargetInfo, AsyncError>
Target facts selected by the owning host.
Trait Implementations§
Source§impl AsyncScopeSource for AppContext
impl AsyncScopeSource for AppContext
fn work_scope(&self) -> Result<AsyncScope, AsyncError>
Source§impl Clone for AppContext
impl Clone for AppContext
Source§fn clone(&self) -> AppContext
fn clone(&self) -> AppContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for AppContext
impl !Send for AppContext
impl !Sync for AppContext
impl !UnwindSafe for AppContext
impl Freeze for AppContext
impl Unpin for AppContext
impl UnsafeUnpin for AppContext
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.