[][src]Struct druid::Application

pub struct Application { /* fields omitted */ }

The top level application object.

This can be thought of as a reference and it can be safely cloned.

Implementations

impl Application[src]

pub fn new() -> Result<Application, Error>[src]

Create a new Application.

Errors

Errors if an Application has already been created.

This may change in the future. See druid#771 for discussion.

pub fn global() -> Application[src]

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.

pub fn try_global() -> Option<Application>[src]

Get the current globally active Application.

A globally active Application exists after new is called and until run returns.

Panics

Panics if called from a non-main thread.

pub fn run(self, handler: Option<Box<dyn AppHandler + 'static>>)[src]

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.

pub fn quit(&self)[src]

Quit the Application.

This will cause run to return control back to the calling function.

pub fn hide(&self)[src]

Hide the application this window belongs to. (cmd+H)

pub fn hide_others(&self)[src]

Hide all other applications. (cmd+opt+H)

pub fn clipboard(&self) -> Clipboard[src]

Returns a handle to the system clipboard.

pub fn get_locale() -> String[src]

Returns the current locale string.

This should a Unicode language identifier.

Trait Implementations

impl Clone for Application[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.