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 headless;
16#[cfg(not(target_arch = "wasm32"))]
17mod os_clipboard;
18#[cfg(not(target_arch = "wasm32"))]
19mod synthetic;
20#[cfg(not(target_arch = "wasm32"))]
21pub mod testing;
22mod window;
23
24#[cfg(not(target_arch = "wasm32"))]
25pub use element_render::{
26 render_element, render_element_with, render_element_with_state, with_fonts, with_headless,
27};
28#[cfg(not(target_arch = "wasm32"))]
29pub use headless::Headless;
30#[cfg(not(target_arch = "wasm32"))]
31pub use os_clipboard::OsClipboard;
32#[cfg(not(target_arch = "wasm32"))]
33pub use synthetic::{SyntheticEvent, render_app};
34pub use window::{WindowOptions, run_app};
35#[cfg(not(target_arch = "wasm32"))]
36pub use window::{run_scene, run_static};
37
38#[derive(Debug)]
40pub enum ShellError {
41 NoDevice,
43 Vello(vello::Error),
45 EventLoop(winit::error::EventLoopError),
47 Readback,
49}
50
51impl fmt::Display for ShellError {
52 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
53 match self {
54 Self::NoDevice => write!(f, "no compute-capable wgpu adapter found"),
55 Self::Vello(e) => write!(f, "vello renderer error: {e}"),
56 Self::EventLoop(e) => write!(f, "winit event loop error: {e}"),
57 Self::Readback => write!(f, "GPU readback failed"),
58 }
59 }
60}
61
62impl std::error::Error for ShellError {}