Skip to main content

frust_shell_desktop/
lib.rs

1//! Desktop preview shell **and shared desktop core**: the primary dev-loop
2//! platform embedding, and the cross-platform half every per-OS desktop shell
3//! crate builds on.
4//!
5//! Wraps winit 0.30's [`ApplicationHandler`](winit::application::ApplicationHandler)
6//! event loop around the Frust render stack (`frust-render` + `frust-engine`), so a
7//! `cargo run` opens the app in a native window with a sub-second rebuild loop
8//! and no mobile toolchain. The facade crate (`frust`) drives this via
9//! [`run_desktop`] (zero-config) or [`run_desktop_with`] (with the app's
10//! [`DesktopConfig`] identity and a per-OS [`DesktopExtensions`] set — see the
11//! [`extensions`] module for the hook contract).
12
13mod app_handler;
14mod cache;
15pub mod config;
16pub mod extensions;
17mod logger;
18mod platform_view;
19mod render;
20mod window_state;
21
22pub use app_handler::{run_desktop, run_desktop_with};
23pub use config::{DEFAULT_APP_NAME, DesktopConfig, IconData, MenuItemSpec, MenuRole, MenuSpec};
24pub use extensions::{CloseAction, DesktopEventLoopBuilder, DesktopExtensions, NoExtensions};
25
26/// The desktop event loop's user-event type, `pub` only so
27/// [`DesktopEventLoopBuilder`] (the builder-stage hook's parameter) can name
28/// it. `#[doc(hidden)]` keeps it out of published docs — the same escape
29/// [`paced_wake`] uses. [`PasteText`] rides along for the same reason and no
30/// other: it is the payload of that type's clipboard-answer variant (the text
31/// the clipboard worker thread read), and a variant carrying a type the crate
32/// root cannot name is a lint, not an API.
33#[doc(hidden)]
34pub use app_handler::{PasteText, ShellUserEvent};
35
36/// Pure, winit-free decision logic behind `ShellHandler`'s paced-wake
37/// mechanism (see the module's own docs). `run_desktop`/`ShellHandler` are
38/// this crate's only real public surface — this module is `pub` purely so
39/// `tests/paced_wake_integration.rs` can drive it as a black box with a fake
40/// advancing clock; `#[doc(hidden)]` keeps it out of published docs.
41#[doc(hidden)]
42pub mod paced_wake;