Struct ApplicationHandle

Source
pub struct ApplicationHandle { /* private fields */ }
Expand description

A thread-unsafe application handle. Often provided by for Browser Window.

Implementations§

Source§

impl ApplicationHandle

Source

pub fn cookie_jar(&self) -> Option<CookieJar>

Returns an instance of a CookieJar, if the underlying browser framework supports it. Currently, only CEF supports cookies.

Source

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

Source

pub fn into_threaded(self) -> ApplicationHandleThreaded

Note: Only available with feature threadsafe enabled.

Transforms this application handle into a thread-safe version of it.

Source

pub fn spawn<F>(&self, future: F)
where F: Future<Output = ()> + 'static,

Spawns the given future, executing it on the GUI thread somewhere in the near future.

Source

pub fn dispatch_delayed<'a, F>(&self, func: F, delay: Duration) -> bool
where 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.

Source

pub async fn sleep(&self, duration: Duration)

Will wait the given duration before returning execution back to the caller. This does not put the current thread in a sleeping state, it just waits.

Trait Implementations§

Source§

impl Clone for ApplicationHandle

Source§

fn clone(&self) -> ApplicationHandle

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl From<ApplicationHandle> for Application

Source§

fn from(other: ApplicationHandle) -> Self

Converts to this type from the input type.
Source§

impl From<ApplicationHandle> for ApplicationHandleThreaded

Source§

fn from(other: ApplicationHandle) -> Self

Converts to this type from the input type.
Source§

impl HasAppHandle for ApplicationHandle

Source§

impl HasHandle<ApplicationHandle> for BrowserWindow

Source§

impl HasHandle<ApplicationHandle> for BrowserWindowHandle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<H> HasHandle<H> for H

Source§

fn handle(&self) -> &H

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V