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 embed;
16#[cfg(not(target_arch = "wasm32"))]
17mod harness;
18#[cfg(not(target_arch = "wasm32"))]
19mod headless;
20#[cfg(not(target_arch = "wasm32"))]
21mod os_clipboard;
22#[cfg(not(target_arch = "wasm32"))]
23mod scenario;
24#[cfg(not(target_arch = "wasm32"))]
25mod synthetic;
26#[cfg(not(target_arch = "wasm32"))]
27pub mod testing;
28mod window;
29
30#[cfg(not(target_arch = "wasm32"))]
31pub use element_render::{
32 render_element, render_element_with, render_element_with_state, with_fonts, with_headless,
33};
34#[cfg(not(target_arch = "wasm32"))]
35pub use embed::{Embedded, EventResponse};
36#[cfg(not(target_arch = "wasm32"))]
37pub use harness::Harness;
38#[cfg(not(target_arch = "wasm32"))]
39pub use headless::Headless;
40#[cfg(not(target_arch = "wasm32"))]
41pub use os_clipboard::OsClipboard;
42#[cfg(not(target_arch = "wasm32"))]
43pub use scenario::{ScenarioError, ScenarioReport, run_scenario};
44#[cfg(not(target_arch = "wasm32"))]
45pub use synthetic::{SyntheticEvent, render_app};
46pub use window::{WindowOptions, run_app};
47
48pub use vello;
51pub use vello::wgpu;
52#[cfg(not(target_arch = "wasm32"))]
53pub use window::{run_scene, run_static};
54pub use winit;
55
56#[derive(Debug)]
58pub enum ShellError {
59 NoDevice,
61 Vello(vello::Error),
63 EventLoop(winit::error::EventLoopError),
65 Readback,
67}
68
69impl fmt::Display for ShellError {
70 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
71 match self {
72 Self::NoDevice => write!(f, "no compute-capable wgpu adapter found"),
73 Self::Vello(e) => write!(f, "vello renderer error: {e}"),
74 Self::EventLoop(e) => write!(f, "winit event loop error: {e}"),
75 Self::Readback => write!(f, "GPU readback failed"),
76 }
77 }
78}
79
80impl std::error::Error for ShellError {}