[][src]Struct browser_window::BrowserWindowBuilder

pub struct BrowserWindowBuilder { /* fields omitted */ }

Used to create a BrowserWindow instance.

Implementations

impl BrowserWindowBuilder[src]

pub fn borders(self, value: bool) -> Self[src]

Sets whether or not the window has borders Default is true.

pub fn handler<H>(self, handler: H) -> Self where
    H: FnMut(BrowserWindowHandle, &str, &[&str]) + Send + 'static, 
[src]

Configure a closure that can be invoked from within JavaScript. The closure's first parameter specifies a command name. The closure's second parameter specifies an array of string arguments.

pub fn maximizable(self, value: bool) -> Self[src]

Sets whether or not the window has a maximize button on the title bar Default is true.

pub fn minimizable(self, value: bool) -> Self[src]

Sets whether or not the window has a minimize button on the title bar Default is true

pub fn parent<B>(self, bw: &B) -> Self where
    B: Deref<Target = BrowserWindowHandle>, 
[src]

Configure a parent window. When a parent window closes, this browser window will close as well. This could be a reference to a BrowserWindow or BrowserWindowAsync handle.

pub fn new(source: Source) -> Self[src]

Creates an instance of a browser window builder.

Arguments

  • source - The content that will be displayed in the browser window.

pub fn title(self, title: String) -> Self[src]

Sets the title of the window

Arguments

  • title - The text that will be displayed in the title bar

pub fn width(self, width: u32) -> Self[src]

Sets the width that the browser window will be created with initially

Arguments

  • width - Width in pixels

pub fn height(self, height: u32) -> Self[src]

Sets the height that the browser window will be created with initially

Arguments

  • height - Height in pixels

pub fn resizable(self, resizable: bool) -> Self[src]

Sets whether or not the window will be resizable Default is true

pub fn spawn<H>(self, app: &Application, on_created: H) where
    H: FnOnce(BrowserWindow), 
[src]

Creates the browser window.

Arguments

  • app - An application handle that this browser window can spawn into
  • on_created - A callback closure that will be invoked when the browser window is created and ready.

pub async fn spawn_async<'_>(
    self,
    app: &'_ ApplicationAsync
) -> BrowserWindowAsync
[src]

Same as spawn, but asynchronous. Instead of providing a callback, the handle is simply returned.

Arguments

  • app - An async application handle.

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, 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.