mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 22:53:15 -04:00
* Update the documentation to reflect web support Indicate which methods have platform-specific web behavior * cargo fmt
23 lines
664 B
Rust
23 lines
664 B
Rust
#![cfg(target_arch = "wasm32")]
|
|
|
|
//! The web target does not automatically insert the canvas element object into the web page, to
|
|
//! allow end users to determine how the page should be laid out. Use the `WindowExtStdweb` or
|
|
//! `WindowExtWebSys` traits (depending on your web backend) to retrieve the canvas from the
|
|
//! Window.
|
|
|
|
#[cfg(feature = "stdweb")]
|
|
use stdweb::web::html_element::CanvasElement;
|
|
|
|
#[cfg(feature = "stdweb")]
|
|
pub trait WindowExtStdweb {
|
|
fn canvas(&self) -> CanvasElement;
|
|
}
|
|
|
|
#[cfg(feature = "web-sys")]
|
|
use web_sys::HtmlCanvasElement;
|
|
|
|
#[cfg(feature = "web-sys")]
|
|
pub trait WindowExtWebSys {
|
|
fn canvas(&self) -> HtmlCanvasElement;
|
|
}
|