pub struct UiEventContext { /* private fields */ }Expand description
Generic application, Store, Router, task and window access passed to every event handler.
Implementations§
Source§impl UiEventContext
impl UiEventContext
pub fn new(application: ApplicationContext, window_id: WindowId) -> Self
pub fn application(&self) -> ApplicationContext
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 fn emit<E>(&self, event: E) -> usizewhere
E: Event,
pub fn spawn(&mut self, task: impl Future<Output = ()> + Send + 'static) -> bool
pub fn spawn_or_else( &mut self, task: impl Future<Output = ()> + Send + 'static, unavailable: impl FnOnce(), )
pub fn spawn_async<Fut>( &mut self, handler: impl FnOnce(UiAsyncContext) -> Fut + Send + 'static, )
pub fn async_context(&self) -> UiAsyncContext
pub fn window(&self) -> WindowHandle
pub fn windows(&self) -> WindowManager
pub fn stop_propagation(&mut self)
pub fn prevent_default(&mut self)
pub fn propagation_stopped(&self) -> bool
pub fn default_prevented(&self) -> bool
pub fn flags(&self) -> UiEventFlags
pub fn mark_consumed(&mut self)
pub fn mark_changed(&mut self, route_changed: bool)
pub fn request_frame(&mut self)
Auto Trait Implementations§
impl Freeze for UiEventContext
impl RefUnwindSafe for UiEventContext
impl Send for UiEventContext
impl Sync for UiEventContext
impl Unpin for UiEventContext
impl UnsafeUnpin for UiEventContext
impl UnwindSafe for UiEventContext
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