Trait wry::WebViewExtWindows

source ·
pub trait WebViewExtWindows {
    // Required methods
    fn controller(&self) -> ICoreWebView2Controller;
    fn set_theme(&self, theme: Theme) -> Result<()>;
    fn set_memory_usage_level(&self, level: MemoryUsageLevel) -> Result<()>;
    fn reparent(&self, hwnd: isize) -> Result<()>;
}
Expand description

Additional methods on WebView that are specific to Windows.

Required Methods§

source

fn controller(&self) -> ICoreWebView2Controller

Returns WebView2 Controller

source

fn set_theme(&self, theme: Theme) -> Result<()>

Changes the webview2 theme.

source

fn set_memory_usage_level(&self, level: MemoryUsageLevel) -> Result<()>

Sets the memory usage target level.

When to best use this mode depends on the app in question. Most commonly it’s called when the app’s visiblity state changes.

Please read the guide for WebView2 for more details.

This method uses a WebView2 API added in Runtime version 114.0.1823.32. When it is used in an older Runtime version, it does nothing.

source

fn reparent(&self, hwnd: isize) -> Result<()>

Attaches this webview to the given HWND and removes it from the current one.

Implementors§