[][src]Struct better_web_view::WebView

pub struct WebView<'a, T: 'a> { /* fields omitted */ }

An owned webview instance.

Construct via a WebViewBuilder.

Methods

impl<'a, T> WebView<'a, T>[src]

pub fn handle(&self) -> Handle<T>[src]

Creates a thread-safe Handle to the WebView, from which closures can be dispatched.

pub fn user_data(&self) -> &T[src]

Borrows the user data immutably.

pub fn user_data_mut(&mut self) -> &mut T[src]

Borrows the user data mutably.

pub fn terminate(&mut self)[src]

Forces the WebView instance to end, without dropping.

pub fn eval(&mut self, js: &str) -> WVResult[src]

Executes the provided string as JavaScript code within the WebView instance.

pub fn inject_css(&mut self, css: &str) -> WVResult[src]

Injects the provided string as CSS within the WebView instance.

pub fn set_color<C: Into<Color>>(&mut self, color: C)[src]

Sets the color of the title bar.

Examples

Without specifying alpha (defaults to 255):

This example is not tested
webview.set_color((123, 321, 213));

Specifying alpha:

This example is not tested
webview.set_color((123, 321, 213, 127));

pub fn set_title(&mut self, title: &str) -> WVResult[src]

Sets the title displayed at the top of the window.

Errors

If title contain a nul byte, returns Error::NulByte.

pub fn set_fullscreen(&mut self, fullscreen: bool)[src]

Enables or disables fullscreen.

pub fn dialog<'b>(&'b mut self) -> DialogBuilder<'a, 'b, T>[src]

Returns a builder for opening a new dialog window.

pub fn step(&mut self) -> Option<WVResult>[src]

Iterates the event loop. Returns None if the view has been closed or terminated.

pub fn run(self) -> WVResult<T>[src]

Runs the event loop to completion and returns the user data.

pub fn into_inner(self) -> T[src]

Consumes the WebView and returns ownership of the user data.

Trait Implementations

impl<'a, T> Drop for WebView<'a, T>[src]

impl<'a, T: Debug + 'a> Debug for WebView<'a, T>[src]

Auto Trait Implementations

impl<'a, T> !Send for WebView<'a, T>

impl<'a, T> !Sync for WebView<'a, T>

Blanket Implementations

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.

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

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

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