Skip to main content

cbf_compositor/
error.rs

1//! Error types returned by `cbf-compositor` public operations.
2
3use thiserror::Error;
4
5/// Errors produced by compositor state management and platform attachment.
6#[derive(Debug, Error)]
7pub enum CompositorError {
8    /// The requested compositor window is not attached.
9    #[error("unknown window")]
10    UnknownWindow,
11    /// The requested browser surface target is not known to the compositor.
12    #[error("unknown surface target")]
13    UnknownTarget,
14    /// The requested scene item is not present in the composition state.
15    #[error("unknown composition item")]
16    UnknownItem,
17    /// The requested scene item cannot accept focus.
18    #[error("composition item is not interactive")]
19    ItemNotInteractive,
20    /// The requested scene item cannot accept hit-test snapshots.
21    #[error("composition item does not use region-based hit testing")]
22    ItemDoesNotUseRegionHitTesting,
23    /// A scene item cannot belong to two compositor windows at once.
24    #[error("composition item is already attached to another window")]
25    ItemOwnedByAnotherWindow,
26    /// A browser surface target cannot appear more than once in the live composition.
27    #[error("surface target is already attached in the live composition")]
28    DuplicateSurfaceTarget,
29    /// The current target/platform combination does not support native hosting.
30    #[error("platform-specific compositor support is unavailable")]
31    PlatformUnsupported,
32}