Skip to content

Commit 3218316

Browse files
authored
Document platform-specific modules
1 parent 2900eca commit 3218316

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

winit/src/platform/mod.rs

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
1-
//! Contains traits with platform-specific methods in them.
1+
//! # Platform implementations
22
//!
3-
//! Only the modules corresponding to the platform you're compiling to will be available.
3+
//! This module re-exports the platform-specific implementation crates that are used by default in
4+
//! Winit.
5+
//!
6+
//! Only the crates / modules corresponding to the platform you're compiling to will be available.
7+
//!
8+
//! | Platform | Crate | Module |
9+
//! | -------- | ----- | ------ |
10+
#![doc = concat!("| Android | [`winit-android`](https://docs.rs/winit-android/", env!("CARGO_PKG_VERSION"), "/) | `winit::platform::android` |")]
11+
#![doc = concat!("| macOS | [`winit-appkit`](https://docs.rs/winit-appkit/", env!("CARGO_PKG_VERSION"), "/) | `winit::platform::macos` |")]
12+
#![doc = concat!("| Redox | [`winit-orbital`](https://docs.rs/winit-orbital/", env!("CARGO_PKG_VERSION"), "/) | `winit::platform::orbital` |")]
13+
#![doc = concat!("| iOS/visionOS/tvOS/Mac Catalyst | [`winit-uikit`](https://docs.rs/winit-uikit/", env!("CARGO_PKG_VERSION"), "/) | `winit::platform::ios` |")]
14+
#![doc = concat!("| Wayland | [`winit-wayland`](https://docs.rs/winit-wayland/", env!("CARGO_PKG_VERSION"), "/) | `winit::platform::wayland` |")]
15+
#![doc = concat!("| Web | [`winit-web`](https://docs.rs/winit-web/", env!("CARGO_PKG_VERSION"), "/) | `winit::platform::web` |")]
16+
#![doc = concat!("| Windows | [`winit-win32`](https://docs.rs/winit-win32/", env!("CARGO_PKG_VERSION"), "/) | `winit::platform::windows` |")]
17+
#![doc = concat!("| X11 | [`winit-x11`](https://docs.rs/winit-x11/", env!("CARGO_PKG_VERSION"), "/) | `winit::platform::x11` |")]
18+
//! ## Common modules
19+
//!
20+
//! Furthermore, we provide two modules for common functionality:
21+
//! - `scancode`, available on Windows, macOS, Wayland and X11.
22+
//! - `startup_notify`, available on Wayland and X11.
423
524
#[cfg(android_platform)]
625
pub use winit_android as android;
@@ -10,8 +29,6 @@ pub use winit_appkit as macos;
1029
pub use winit_orbital as orbital;
1130
#[cfg(ios_platform)]
1231
pub use winit_uikit as ios;
13-
#[cfg(any(x11_platform, wayland_platform))]
14-
pub mod startup_notify;
1532
#[cfg(wayland_platform)]
1633
pub use winit_wayland as wayland;
1734
#[cfg(web_platform)]
@@ -23,3 +40,5 @@ pub use winit_x11 as x11;
2340

2441
#[cfg(any(windows_platform, macos_platform, x11_platform, wayland_platform, docsrs))]
2542
pub mod scancode;
43+
#[cfg(any(x11_platform, wayland_platform, docsrs))]
44+
pub mod startup_notify;

0 commit comments

Comments
 (0)