[−][src]Crate webview2
Rust bindings for WebView2.
The Edge browser from beta, dev or canary channels (>= 86.0.579.0) or the
Evergreen WebView2
Runtime
need to be installed for this to actually work. Or the
build
method will return an
error.
By default, this crate ships a copy of the WebView2Loader.dll
file for the
target platform. At runtime, this dll will be loaded from memory with the
memory-module-sys library.
License of the DLL file (part of the WebView2 SDK) is included in the
Microsoft.Web.WebView2.0.9.579
folder. You can also use an external
WebView2Loader.dll
file.
There are high level, idiomatic Rust wrappers for most APIs. And there are
bindings to almost all the raw COM APIs in the webview2-sys
crate. You can
use the as_inner
methods to convert to raw COM objects and call all those
methods. The callback
macro can be helpful for implementing callbacks as
COM objects.
There are some examples in the examples directory.
Minimum supported rust version (MSRV): 1.43.0
Macros
callback | Returns a pointer that implements the COM callback interface with the specified closure. Inspired by C++ Microsoft::WRT::Callback. |
Structs
AcceleratorKeyPressedEventArgs | Wrapper for |
ContentLoadingEventArgs | Wrapper for |
Controller | Wrapper for |
Deferral | Wrapper for |
DevToolsProtocolEventReceivedEventArgs | Wrapper for |
DevToolsProtocolEventReceiver | Wrapper for |
Environment | Wrapper for |
EnvironmentBuilder | A builder for calling the |
EnvironmentOptions | Wrapper for |
Error | WebView2 Error. |
EventRegistrationToken | Represents a reference to a delegate that receives change notifications. |
HttpHeadersCollectionIterator | Wrapper for |
HttpRequestHeaders | Wrapper for |
HttpResponseHeaders | Wrapper for |
MoveFocusRequestedEventArgs | Wrapper for |
NavigationCompletedEventArgs | Wrapper for |
NavigationStartingEventArgs | Wrapper for |
NewWindowRequestedEventArgs | Wrapper for |
PermissionRequestedEventArgs | Wrapper for |
PhysicalKeyStatus | A structure representing the information packed into the LPARAM given to a Win32 key event. See the documentation for WM_KEYDOWN for details at https://docs.microsoft.com/windows/win32/inputdev/wm-keydown |
ProcessFailedEventArgs | Wrapper for |
ScriptDialogOpeningEventArgs | Wrapper for |
Settings | Wrapper for |
SourceChangedEventArgs | Wrapper for |
Stream | Wrapper for |
WebMessageReceivedEventArgs | Wrapper for |
WebResourceRequest | Wrapper for |
WebResourceRequestedEventArgs | Wrapper for |
WebResourceResponse | Wrapper for |
WebView | Wrapper for |
Enums
CapturePreviewImageFormat | Image format used by the ICoreWebView2::CapturePreview method. |
KeyEventKind | The type of key event that triggered an AcceleratorKeyPressed event. |
MoveFocusReason | Reason for moving focus. |
PermissionKind | The type of a permission request. |
PermissionState | Response to a permission request. |
ProcessFailedKind | Kind of process failure used in the ICoreWebView2ProcessFailedEventHandler interface. |
ScriptDialogKind | Kind of JavaScript dialog used in the ICoreWebView2ScriptDialogOpeningEventHandler interface. |
WebErrorStatus | Error status values for web navigations. |
WebResourceContext | Enum for web resource request contexts. |
Functions
check_hresult | Check a |
Type Definitions
Result |