1use std::fmt;
6
7#[cfg(not(target_arch = "wasm32"))]
11mod access;
12#[cfg(not(target_arch = "wasm32"))]
13mod element_render;
14#[cfg(not(target_arch = "wasm32"))]
15mod harness;
16#[cfg(not(target_arch = "wasm32"))]
17mod headless;
18#[cfg(not(target_arch = "wasm32"))]
19mod os_clipboard;
20#[cfg(not(target_arch = "wasm32"))]
21mod scenario;
22#[cfg(not(target_arch = "wasm32"))]
23mod synthetic;
24#[cfg(not(target_arch = "wasm32"))]
25pub mod testing;
26mod window;
27
28#[cfg(not(target_arch = "wasm32"))]
29pub use element_render::{
30 render_element, render_element_with, render_element_with_state, with_fonts, with_headless,
31};
32#[cfg(not(target_arch = "wasm32"))]
33pub use harness::Harness;
34#[cfg(not(target_arch = "wasm32"))]
35pub use headless::Headless;
36#[cfg(not(target_arch = "wasm32"))]
37pub use os_clipboard::OsClipboard;
38#[cfg(not(target_arch = "wasm32"))]
39pub use scenario::{ScenarioError, ScenarioReport, run_scenario};
40#[cfg(not(target_arch = "wasm32"))]
41pub use synthetic::{SyntheticEvent, render_app};
42pub use window::{WindowOptions, run_app};
43#[cfg(not(target_arch = "wasm32"))]
44pub use window::{run_scene, run_static};
45
46#[derive(Debug)]
48pub enum ShellError {
49 NoDevice,
51 Vello(vello::Error),
53 EventLoop(winit::error::EventLoopError),
55 Readback,
57}
58
59impl fmt::Display for ShellError {
60 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
61 match self {
62 Self::NoDevice => write!(f, "no compute-capable wgpu adapter found"),
63 Self::Vello(e) => write!(f, "vello renderer error: {e}"),
64 Self::EventLoop(e) => write!(f, "winit event loop error: {e}"),
65 Self::Readback => write!(f, "GPU readback failed"),
66 }
67 }
68}
69
70impl std::error::Error for ShellError {}