Display all platform-specific documentation on docs.rs (#3076)

This commit is contained in:
Mads Marquart 2024-01-04 12:54:35 +01:00 committed by GitHub
parent 8b3de7cedf
commit 42dbc4748e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 810 additions and 814 deletions

View file

@ -35,8 +35,13 @@ use crate::platform_impl::PlatformCustomCursorBuilder;
use crate::window::CustomCursor;
use crate::window::{Window, WindowBuilder};
#[cfg(wasm_platform)]
use web_sys::HtmlCanvasElement;
#[cfg(not(wasm_platform))]
#[doc(hidden)]
pub struct HtmlCanvasElement;
pub trait WindowExtWebSys {
/// Only returns the canvas if called from inside the window context (the
/// main thread).
@ -80,6 +85,11 @@ pub trait WindowBuilderExtWebSys {
/// In any case, the canvas won't be automatically inserted into the web page.
///
/// [`None`] by default.
#[cfg_attr(
not(wasm_platform),
doc = "",
doc = "[`HtmlCanvasElement`]: #only-available-on-wasm"
)]
fn with_canvas(self, canvas: Option<HtmlCanvasElement>) -> Self;
/// Sets whether `event.preventDefault()` should be called on events on the