Struct druid::Application
source · pub struct Application { /* private fields */ }
Expand description
The top level application object.
This can be thought of as a reference and it can be safely cloned.
Implementations§
source§impl Application
impl Application
sourcepub fn new() -> Result<Application, Error>
pub fn new() -> Result<Application, Error>
sourcepub fn global() -> Application
pub fn global() -> Application
Get the current globally active Application
.
A globally active Application
exists
after new
is called and until run
returns.
Panics
Panics if there is no globally active Application
.
For a non-panicking function use try_global
.
This function will also panic if called from a non-main thread.
sourcepub fn try_global() -> Option<Application>
pub fn try_global() -> Option<Application>
sourcepub fn run(self, handler: Option<Box<dyn AppHandler + 'static, Global>>)
pub fn run(self, handler: Option<Box<dyn AppHandler + 'static, Global>>)
Start the Application
runloop.
The provided handler
will be used to inform of events.
This will consume the Application
and block the current thread
until the Application
has finished executing.
Panics
Panics if the Application
is already running.
sourcepub fn quit(&self)
pub fn quit(&self)
Quit the Application
.
This will cause run
to return control back to the calling function.
sourcepub fn get_locale() -> String
pub fn get_locale() -> String
Returns the current locale string.
This should a Unicode language identifier.
Trait Implementations§
source§impl Clone for Application
impl Clone for Application
source§fn clone(&self) -> Application
fn clone(&self) -> Application
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more