wingy_core/lib.rs
1//! # Core types for Wingy
2//!
3//! Platform-agnostic types and traits useful when implementing Wingy backends,
4//! or otherwise interfacing with Wingy from library code.
5//!
6//! See the [`wingy`] crate for the full user-facing API.
7//!
8//! [`wingy`]: https://docs.rs/wingy
9
10// Every newly exported enum should either be `#[non_exhaustive]`, or carry an `#[allow]` of
11// this lint when the set of variants can never grow.
12// `clippy::exhaustive_structs` is deliberately not enabled: event structs must stay
13// constructible by the backend crates, which `#[non_exhaustive]` would forbid.
14#![warn(clippy::exhaustive_enums)]
15
16#[macro_use]
17pub mod casting;
18pub mod cursor;
19#[macro_use]
20pub mod error;
21pub mod application;
22pub mod data_transfer;
23pub mod event;
24pub mod event_loop;
25pub mod icon;
26pub mod keyboard;
27pub mod monitor;
28pub mod window;
29
30// `Instant` is not actually available on `wasm32-unknown-unknown`, the `std` implementation there
31// is a stub. And `wasm32-none` doesn't even have `std`. Instead, we use `web_time::Instant`.
32#[cfg(not(all(target_family = "wasm", any(target_os = "unknown", target_os = "none"))))]
33pub(crate) use std::time::Instant;
34
35#[cfg(all(target_family = "wasm", any(target_os = "unknown", target_os = "none")))]
36pub(crate) use web_time::Instant;