1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/// Errors returned by the plugin's public API.
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum GpuiError {
/// [`crate::init`] has not been called (or failed) for this application.
#[error("tauri-plugin-gpui is not initialized; call `tauri_plugin_gpui::init(app)` in `setup`")]
NotInitialized,
/// [`crate::init`] was called more than once.
#[error("tauri-plugin-gpui is already initialized")]
AlreadyInitialized,
/// GPUI is already attached to this window. Attachment is permanent.
#[error("GPUI is already attached to window `{label}`")]
AlreadyAttached {
/// Label of the Tauri window.
label: String,
},
/// The window cannot host a GPUI surface (for example it already hosts a WebView).
#[error("window `{label}` is not eligible for GPUI attachment: {reason}")]
NotEligible {
/// Label of the Tauri window.
label: String,
/// Why the window cannot be attached.
reason: &'static str,
},
/// The call must happen on the Tauri/TAO event-loop thread.
#[error("must be called on the Tauri event-loop (main) thread")]
NotMainThread,
/// The shared GPUI `App` is already borrowed further up the stack.
#[error("the shared GPUI App is already in use further up the call stack")]
Reentrant,
/// The operation is outside the minimal GPUI platform adapter.
#[error("unsupported operation: {operation}")]
UnsupportedOperation {
/// Name of the unsupported operation.
operation: &'static str,
},
/// The GPUI platform adapter could not be created.
#[error("GPUI platform initialization failed: {0}")]
PlatformInitialization(String),
/// The GPU renderer for a window could not be created.
#[error("GPUI renderer initialization failed: {0}")]
RendererInitialization(String),
/// An error reported by Tauri while querying the window.
#[error(transparent)]
Tauri(#[from] tauri::Error),
}