Expand description
§Web
Winit supports running in Browsers by compiling to WebAssembly with
wasm-bindgen. For information on using Rust on WebAssembly, check out the
Rust and WebAssembly book.
The officially supported browsers are Chrome, Firefox and Safari 13.1+, though forks of these should work fine.
On the Web platform, a Winit Window is backed by a HTMLCanvasElement. Winit will
create that canvas for you or you can provide your own. Then you can either let
Winit insert it into the DOM for you, or retrieve the canvas and insert it
yourself.
§CSS properties
It is recommended not to apply certain CSS properties to the canvas:
The following APIs can’t take them into account and will therefore provide inaccurate results:
Structs§
- Custom
Cursor Future - Event
Loop - HasMonitor
Permission Future - Monitor
Permission Future - Can be dropped without aborting the request for detailed monitor permissions.
- Orientation
Data - Screen orientation data.
- Orientation
Lock Future - Can be dropped without aborting the request to lock the screen.
- Platform
Specific Event Loop Attributes - Window
Attributes Web
Enums§
- Custom
Cursor Error - Monitor
Permission Error - Orientation
- Screen orientation.
- Orientation
Lock - Screen orientation lock options. Represents which orientations a user can use.
- Orientation
Lock Error - Poll
Strategy - Strategy used for [
ControlFlow::Poll][crate::event_loop::ControlFlow::Poll]. - Wait
Until Strategy - Strategy used for [
ControlFlow::WaitUntil][crate::event_loop::ControlFlow::WaitUntil].
Traits§
- Active
Event Loop ExtWeb - Event
Loop ExtWeb - Additional methods on
EventLoopthat are specific to the Web. - Monitor
Handle ExtWeb - Additional methods on
MonitorHandlethat are specific to the Web. - Window
ExtWeb