pub struct App<A: Application> { /* private fields */ }Expand description
The event handler that drives an Application: it owns the window, the renderer, the
last interface built and the runtime, and turns each event of the loop into messages,
frames and effects. run and the other entry points build one; it is
exported for a platform layer that supplies its own loop, not for an application to
construct.
Implementations§
Source§impl<A: Application> App<A>
impl<A: Application> App<A>
Sourcepub fn new(app: A, proxy: EventLoopProxy<A::Message>) -> Self
pub fn new(app: A, proxy: EventLoopProxy<A::Message>) -> Self
Creates the driver around an application and its message channel.
Trait Implementations§
Source§impl<A: Application> ApplicationHandler<<A as Application>::Message> for App<A>
impl<A: Application> ApplicationHandler<<A as Application>::Message> for App<A>
Source§fn suspended(&mut self, _event_loop: &ActiveEventLoop)
fn suspended(&mut self, _event_loop: &ActiveEventLoop)
Going to the background, on Android: the native surface is destroyed. We
release the renderer and the window, and resumed recreates them on the way
back, without replaying init — see started. Harmless on desktop, where the
event never fires.
Source§fn exiting(&mut self, _event_loop: &ActiveEventLoop)
fn exiting(&mut self, _event_loop: &ActiveEventLoop)
The event loop is ending, on close: a final Detached notification, where the
app can persist its state before the process disappears.
Source§fn user_event(&mut self, _event_loop: &ActiveEventLoop, message: A::Message)
fn user_event(&mut self, _event_loop: &ActiveEventLoop, message: A::Message)
A message produced by an effect, on a background thread: we apply it and ask for another frame.
Source§fn new_events(&mut self, event_loop: &ActiveEventLoop, cause: StartCause)
fn new_events(&mut self, event_loop: &ActiveEventLoop, cause: StartCause)
The loop woke up: if the long-press deadline has been reached the recogniser accepts eagerly — the message is emitted and the release to come will be swallowed, the long press having evicted the tap.
Source§fn resumed(&mut self, event_loop: &ActiveEventLoop)
fn resumed(&mut self, event_loop: &ActiveEventLoop)
Source§fn window_event(
&mut self,
event_loop: &ActiveEventLoop,
_window_id: WindowId,
event: WindowEvent,
)
fn window_event( &mut self, event_loop: &ActiveEventLoop, _window_id: WindowId, event: WindowEvent, )
Source§fn device_event(
&mut self,
event_loop: &ActiveEventLoop,
device_id: DeviceId,
event: DeviceEvent,
)
fn device_event( &mut self, event_loop: &ActiveEventLoop, device_id: DeviceId, event: DeviceEvent, )
Source§fn about_to_wait(&mut self, event_loop: &ActiveEventLoop)
fn about_to_wait(&mut self, event_loop: &ActiveEventLoop)
Source§fn memory_warning(&mut self, event_loop: &ActiveEventLoop)
fn memory_warning(&mut self, event_loop: &ActiveEventLoop)
Auto Trait Implementations§
impl<A> !Freeze for App<A>
impl<A> !RefUnwindSafe for App<A>
impl<A> !Send for App<A>
impl<A> !Sync for App<A>
impl<A> !UnwindSafe for App<A>
impl<A> Unpin for App<A>where
A: Unpin,
Mailbox<<A as Application>::Message>: Unpin,
Option<Ui<<A as Application>::Message>>: Unpin,
Option<Box<dyn Widget<<A as Application>::Message>>>: Unpin,
Option<<A as Application>::Message>: Unpin,
Option<PendingTap<<A as Application>::Message>>: Unpin,
impl<A> UnsafeUnpin for App<A>where
A: UnsafeUnpin,
Mailbox<<A as Application>::Message>: UnsafeUnpin,
Option<Ui<<A as Application>::Message>>: UnsafeUnpin,
Option<Box<dyn Widget<<A as Application>::Message>>>: UnsafeUnpin,
Option<<A as Application>::Message>: UnsafeUnpin,
Option<PendingTap<<A as Application>::Message>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.