use thiserror::Error;
use crate::sync::SyncMechanism;
#[derive(Clone, Debug, Eq, PartialEq)]
#[non_exhaustive]
pub enum UnsupportedReason {
PlatformNotImplemented,
HostBackendUnavailable,
HostBackendMismatch,
NativeImportNotYetImplemented,
}
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum InteropError {
#[error("unsupported interop path: {0:?}")]
Unsupported(UnsupportedReason),
#[error("backend mismatch: expected {expected}, found {actual}")]
BackendMismatch {
expected: &'static str,
actual: &'static str,
},
#[error("invalid frame: {0}")]
InvalidFrame(&'static str),
#[error("unsupported synchronization mechanism: {0:?}")]
UnsupportedSynchronization(SyncMechanism),
#[error("surfman interop failed: {0}")]
Surfman(String),
#[error("vulkan interop failed: {0}")]
Vulkan(String),
#[error("metal interop failed: {0}")]
Metal(String),
#[error("OpenGL interop failed: {0}")]
OpenGl(String),
#[error("D3D12 interop failed: {0}")]
Dx12(String),
#[error("ANGLE EGL interop failed: {0}")]
Angle(String),
}