[go: up one dir, main page]

Crate winit_web

Crate winit_web 

Source
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§

CustomCursorFuture
EventLoop
HasMonitorPermissionFuture
MonitorPermissionFuture
Can be dropped without aborting the request for detailed monitor permissions.
OrientationData
Screen orientation data.
OrientationLockFuture
Can be dropped without aborting the request to lock the screen.
PlatformSpecificEventLoopAttributes
WindowAttributesWeb

Enums§

CustomCursorError
MonitorPermissionError
Orientation
Screen orientation.
OrientationLock
Screen orientation lock options. Represents which orientations a user can use.
OrientationLockError
PollStrategy
Strategy used for [ControlFlow::Poll][crate::event_loop::ControlFlow::Poll].
WaitUntilStrategy
Strategy used for [ControlFlow::WaitUntil][crate::event_loop::ControlFlow::WaitUntil].

Traits§

ActiveEventLoopExtWeb
EventLoopExtWeb
Additional methods on EventLoop that are specific to the Web.
MonitorHandleExtWeb
Additional methods on MonitorHandle that are specific to the Web.
WindowExtWeb