#[non_exhaustive]pub struct Args<'a, A: Application> {
pub window: &'a mut MainWindowWithRenderer,
pub event_loop: &'a ActiveEventLoop,
pub event_proxy: &'a EventLoopProxy<AppEvent<A>>,
pub data: &'a mut A::Data,
}Expand description
This type is an aggregate of values retured by AppHandler.
With this you don’t need to have a buch of use that you probably
don’t care about.
Since this is not Send it is always used from the main loop, and it can be
used to send non Send callbacks to the idle loop.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.window: &'a mut MainWindowWithRendererThe main window.
event_loop: &'a ActiveEventLoopThe event loop.
event_proxy: &'a EventLoopProxy<AppEvent<A>>A proxy to send messages to the main loop.
data: &'a mut A::DataThe custom application data.
Implementations§
Source§impl<A: Application> Args<'_, A>
impl<A: Application> Args<'_, A>
pub fn reborrow(&mut self) -> Args<'_, A>
Sourcepub fn local_proxy(&self) -> LocalProxy<A>
pub fn local_proxy(&self) -> LocalProxy<A>
Creates a LocalProxy that is Clone but not Send.
Sourcepub fn ping_user_input(&mut self)
pub fn ping_user_input(&mut self)
Helper function to call ping_user_input in the main window.
Sourcepub fn spawn_idle<T: 'static, F: Future<Output = T> + 'static>(
&self,
f: F,
) -> FutureHandle<T>
pub fn spawn_idle<T: 'static, F: Future<Output = T> + 'static>( &self, f: F, ) -> FutureHandle<T>
Registers a future to be run during the idle step of the main loop.
Sourcepub fn run_idle<F: FnOnce(&mut A, Args<'_, A>) + 'static>(
&self,
f: F,
) -> Result<(), EventLoopClosed<()>>
pub fn run_idle<F: FnOnce(&mut A, Args<'_, A>) + 'static>( &self, f: F, ) -> Result<(), EventLoopClosed<()>>
Registers a callback to be called during the idle step of the main loop.
Sourcepub fn future_back(&self) -> FutureBackCaller<A>
pub fn future_back(&self) -> FutureBackCaller<A>
Creates a FutureBackCaller for this application.
Auto Trait Implementations§
impl<'a, A> Freeze for Args<'a, A>
impl<'a, A> !RefUnwindSafe for Args<'a, A>
impl<'a, A> !Send for Args<'a, A>
impl<'a, A> !Sync for Args<'a, A>
impl<'a, A> Unpin for Args<'a, A>
impl<'a, A> !UnwindSafe for Args<'a, A>
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
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more