[][src]Struct browser_window::BrowserWindow

pub struct BrowserWindow { /* fields omitted */ }

A thread-unsafe handle to a browser window.

Methods from Deref<Target = BrowserWindowHandle>

pub fn eval_js<'a, H>(&self, js: &str, on_complete: H) where
    H: FnOnce(BrowserWindowHandle, Result<String, Box<dyn Error + Send>>) + Send + 'a, 
[src]

Executes the given javascript code, and returns the output via a callback. If you don't need the result, see "exec_js".

Arguments:

  • js - The javascript code to execute.
  • on_complete - The 'callback'. This closure will be invoked, with the result provided as the first argument. The result contains the output of the javascript code when it succeeded. Otherwise the error explains the javascript exception.

pub fn exec_js(&self, js: &str)[src]

Executes the given javascript code without waiting on it to finish.

Arguments:

  • js - The javascript code

pub 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 BrowserWindow[src]

impl Deref for BrowserWindow[src]

type Target = BrowserWindowHandle

The resulting type after dereferencing.

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.