Skip to main content

UiEventContext

Struct UiEventContext 

Source
pub struct UiEventContext { /* private fields */ }
Expand description

Generic application, Store, Router, task and window access passed to every event handler.

Implementations§

Source§

impl UiEventContext

Source

pub fn new(application: ApplicationContext, window_id: WindowId) -> Self

Source

pub fn application(&self) -> ApplicationContext

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 fn emit<E>(&self, event: E) -> usize
where E: Event,

Source

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

Source

pub fn spawn_or_else( &mut self, task: impl Future<Output = ()> + Send + 'static, unavailable: impl FnOnce(), )

Source

pub fn spawn_async<Fut>( &mut self, handler: impl FnOnce(UiAsyncContext) -> Fut + Send + 'static, )
where Fut: Future<Output = ()> + Send + 'static,

Source

pub fn async_context(&self) -> UiAsyncContext

Source

pub fn window(&self) -> WindowHandle

Source

pub fn windows(&self) -> WindowManager

Source

pub fn stop_propagation(&mut self)

Source

pub fn prevent_default(&mut self)

Source

pub fn propagation_stopped(&self) -> bool

Source

pub fn default_prevented(&self) -> bool

Source

pub fn flags(&self) -> UiEventFlags

Source

pub fn mark_consumed(&mut self)

Source

pub fn mark_changed(&mut self, route_changed: bool)

Source

pub fn request_frame(&mut self)

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> 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, 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.