pub struct ApplicationContext { /* private fields */ }Implementations§
Source§impl ApplicationContext
impl ApplicationContext
pub fn empty(memory_options: MemoryOptions) -> Self
pub fn resources(&self) -> &Resources
pub fn memory(&self) -> &MemoryGovernor
Sourcepub fn register_memory_domain(&self, registration: DomainRegistration)
pub fn register_memory_domain(&self, registration: DomainRegistration)
Registers an application-owned cache adapter and retains it for this context’s lifetime.
pub fn resource<T>(&self) -> Arc<T> ⓘ
pub fn try_resource<T>(&self) -> Option<Arc<T>>
pub fn command<C>(&self) -> CommandHandle<C>where
C: Command,
pub async fn invoke<C>(&self, args: C::Args) -> Result<C::Output, C::Error>where
C: Command,
pub fn emit<E>(&self, event: E) -> usizewhere
E: Event,
pub fn subscribe<E>(
&self,
listener: impl Fn(E) + Send + Sync + 'static,
) -> EventSubscriptionwhere
E: Event,
pub fn subscribe_keyed<T>( &self, key: EventKey<T>, listener: impl Fn(T) + Send + Sync + 'static, ) -> EventSubscription
pub fn set_executor(&self, executor: UiTaskSpawner)
pub fn spawn(&self, task: impl Future<Output = ()> + Send + 'static) -> bool
Sourcepub fn scope<F>(&self, future: F) -> impl Future<Output = F::Output>where
F: Future,
pub fn scope<F>(&self, future: F) -> impl Future<Output = F::Output>where
F: Future,
Runs a Future with this Application as the active context on every poll.
LGUI task APIs apply this automatically. Use scope when an
application-owned Future is submitted to an external executor.
pub fn windows(&self) -> WindowManager
Trait Implementations§
Source§impl Clone for ApplicationContext
impl Clone for ApplicationContext
Source§fn clone(&self) -> ApplicationContext
fn clone(&self) -> ApplicationContext
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 Freeze for ApplicationContext
impl RefUnwindSafe for ApplicationContext
impl Send for ApplicationContext
impl Sync for ApplicationContext
impl Unpin for ApplicationContext
impl UnsafeUnpin for ApplicationContext
impl UnwindSafe for ApplicationContext
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