Available on
web_platform only.Expand description
§Web
The officially supported browsers are Chrome, Firefox and Safari 13.1+, though forks of these should work fine.
Winit supports compiling to the wasm32-unknown-unknown target with
web-sys.
On the web platform, a Winit window is backed by a <canvas> element. You
can either provide Winit with a <canvas> element, or
let Winit create a <canvas> element which you can then retrieve
and insert it into the DOM yourself.
Currently, there is no example code using Winit on Web, see #3473. For information on using Rust on WebAssembly, check out the Rust and WebAssembly book.
§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§
Enums§
- BadAnimation
- An error produced when using
CustomCursor::from_animationwith invalid arguments. - Custom
Cursor Error - Poll
Strategy - Strategy used for
ControlFlow::Poll. - Wait
Until Strategy - Strategy used for
ControlFlow::WaitUntil.
Traits§
- Active
Event Loop ExtWeb Sys - Custom
Cursor ExtWeb Sys - Event
Loop ExtWeb Sys - Additional methods on
EventLoopthat are specific to the web. - Window
Attributes ExtWeb Sys - Window
ExtWeb Sys