Struct wry::webview::WebView[][src]

pub struct WebView { /* fields omitted */ }

The fundamental type to present a WebView.

WebViewBuilder / WebView are the basic building blocks to constrcut WebView contents and scripts for those who prefer to control fine grained window creation and event handling. WebView presents the actuall WebView window and let you still able to perform actions during event handling to it. WebView also contains the associate Window with it.

Implementations

impl WebView[src]

pub fn new(window: Window) -> Result<Self>[src]

Create a WebView from provided Window. Note that calling this directly loses abilities to initialize scripts, add rpc handler, and many more before starting WebView. To benefit from above features, create a WebViewBuilder instead.

Platform-specific behavior:

  • Unix: This method must be called in a gtk thread. Usually this means it should be called in the same thread with the EventLoop you create.

pub fn dispatch_script(&mut self, js: &str) -> Result<()>[src]

Dispatch javascript code to be evaluated later. Note this will not actually run the scripts being dispatched. Users need to call WebView::evaluate_script to execute them.

pub fn dispatcher(&self) -> Dispatcher[src]

Create a Dispatcher to send evaluation scripts to the WebView. WebView is not thread safe because it must be run on the main thread who creates it. Dispatcher can let you send the scripts from other threads.

pub fn window(&self) -> &Window[src]

Get the Window associate with the WebView. This can let you perform window related actions.

pub fn evaluate_script(&self) -> Result<()>[src]

Evaluate the scripts sent from Dispatchers.

pub fn print(&self) -> Result<()>[src]

Launch print modal for the webview content. Works only on macOS for now.

pub fn resize(&self) -> Result<()>[src]

Resize the WebView manually. This is required on Windows because its WebView API doesn’t provide a way to resize automatically.

Trait Implementations

impl Drop for WebView[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl !RefUnwindSafe for WebView

impl !Send for WebView

impl !Sync for WebView

impl Unpin for WebView

impl !UnwindSafe for WebView

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

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

Immutably borrows from an owned value. Read more

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

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

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

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.

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

Performs the conversion.

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.

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

Performs the conversion.