Skip to main content

ApplicationContext

Struct ApplicationContext 

Source
pub struct ApplicationContext { /* private fields */ }

Implementations§

Source§

impl ApplicationContext

Source

pub fn empty(memory_options: MemoryOptions) -> Self

Source

pub fn resources(&self) -> &Resources

Source

pub fn memory(&self) -> &MemoryGovernor

Source

pub fn register_memory_domain(&self, registration: DomainRegistration)

Registers an application-owned cache adapter and retains it for this context’s lifetime.

Source

pub fn resource<T>(&self) -> Arc<T>
where T: Send + Sync + 'static,

Source

pub fn try_resource<T>(&self) -> Option<Arc<T>>
where T: Send + Sync + 'static,

Source

pub fn command<C>(&self) -> CommandHandle<C>
where C: Command,

Source

pub async fn invoke<C>(&self, args: C::Args) -> Result<C::Output, C::Error>
where C: Command,

Source

pub fn emit<E>(&self, event: E) -> usize
where E: Event,

Source

pub fn subscribe<E>( &self, listener: impl Fn(E) + Send + Sync + 'static, ) -> EventSubscription
where E: Event,

Source

pub fn subscribe_keyed<T>( &self, key: EventKey<T>, listener: impl Fn(T) + Send + Sync + 'static, ) -> EventSubscription
where T: Clone + Send + Sync + 'static,

Source

pub fn set_executor(&self, executor: UiTaskSpawner)

Source

pub fn spawn(&self, task: impl Future<Output = ()> + Send + 'static) -> bool

Source

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.

Source

pub fn windows(&self) -> WindowManager

Trait Implementations§

Source§

impl Clone for ApplicationContext

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl PartialEq for ApplicationContext

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.