[][src]Struct browser_window::BrowserWindowAsync

pub struct BrowserWindowAsync { /* fields omitted */ }

A thread-safe handle to a browser window. It allows you to dispatch code to the GUI thread.

Implementations

impl BrowserWindowAsync[src]

pub async fn close(self)[src]

Closes the browser.

pub fn dispatch<'a, F, R>(&self, func: F) -> BrowserWindowDispatchFuture<'a, R> where
    F: FnOnce(BrowserWindowHandle) -> R + Send + 'a,
    R: Send
[src]

Executes the given closure within the GUI thread

Arguments

  • func - The closure to run on the GUI thread

pub async fn eval_js<'_, '_>(
    &'_ self,
    js: &'_ str
) -> Result<String, Box<dyn Error + Send>>
[src]

Executes the given javascript code, and returns the resulting output as a string when done.

Arguments:

  • js - Javascript code

pub async fn navigate<'_, '_>(
    &'_ self,
    url: &'_ str
) -> Result<(), Box<dyn Error + Send>>
[src]

Causes the browser to navigate to the given url.

Arguments

  • url - The url to navigate to

Trait Implementations

impl Clone for BrowserWindowAsync[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> 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.