Struct browser_window::application::ApplicationHandle
source · pub struct ApplicationHandle { /* private fields */ }
Expand description
A thread-unsafe application handle. Often provided by for Browser Window.
Implementations§
source§impl ApplicationHandle
impl ApplicationHandle
sourcepub fn exit(&self, exit_code: i32)
pub fn exit(&self, exit_code: i32)
Causes the Runtime
to terminate.
The Runtime
’s Runtime::run
or spawn command will return the exit code provided.
This will mean that not all tasks might complete.
If you were awaiting
sourcepub fn into_threaded(self) -> ApplicationHandleThreaded
pub fn into_threaded(self) -> ApplicationHandleThreaded
Note: Only available with feature threadsafe
enabled.
Transforms this application handle into a thread-safe version of it.
sourcepub fn spawn<F>(&self, future: F)
pub fn spawn<F>(&self, future: F)
Spawns the given future, executing it on the GUI thread somewhere in the near future.
sourcepub fn dispatch_delayed<'a, F>(&self, func: F, delay: Duration) -> boolwhere
F: FnOnce(ApplicationHandle) + 'a,
pub fn dispatch_delayed<'a, F>(&self, func: F, delay: Duration) -> boolwhere
F: FnOnce(ApplicationHandle) + 'a,
Queues the given closure func
to be executed on the GUI thread somewhere in the future, at least after the given delay.
The closure will only execute when and if the runtime is still running.
Returns whether or not the closure will be able to execute.
Trait Implementations§
source§impl Clone for ApplicationHandle
impl Clone for ApplicationHandle
source§fn clone(&self) -> ApplicationHandle
fn clone(&self) -> ApplicationHandle
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl From<ApplicationHandle> for Application
impl From<ApplicationHandle> for Application
source§fn from(other: ApplicationHandle) -> Self
fn from(other: ApplicationHandle) -> Self
Converts to this type from the input type.
source§impl From<ApplicationHandle> for ApplicationHandleThreaded
impl From<ApplicationHandle> for ApplicationHandleThreaded
source§fn from(other: ApplicationHandle) -> Self
fn from(other: ApplicationHandle) -> Self
Converts to this type from the input type.
source§impl HasAppHandle for ApplicationHandle
impl HasAppHandle for ApplicationHandle
fn app_handle(&self) -> ApplicationHandle
impl Copy for ApplicationHandle
Auto Trait Implementations§
impl RefUnwindSafe for ApplicationHandle
impl !Send for ApplicationHandle
impl !Sync for ApplicationHandle
impl Unpin for ApplicationHandle
impl UnwindSafe for ApplicationHandle
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