windows_api_utils/
error.rs1#[cfg(feature = "std")]
7use thiserror::Error;
8
9#[cfg_attr(feature = "std", derive(Error))]
11#[cfg_attr(not(feature = "std"), derive(Debug, Clone, PartialEq))]
12#[derive(Debug, Clone, PartialEq)]
13pub enum WindowsUtilsError {
14 #[cfg_attr(feature = "std", error("Invalid coordinates: ({x}, {y})"))]
16 InvalidCoordinates {
17 x: i32,
19 y: i32,
21 },
22
23 #[cfg_attr(feature = "std", error("Point ({x}, {y}) is outside window bounds"))]
25 OutOfBounds {
26 x: i32,
28 y: i32,
30 },
31
32 #[cfg_attr(feature = "std", error("Invalid window handle: {handle}"))]
34 InvalidWindowHandle {
35 handle: isize,
37 },
38
39 #[cfg_attr(feature = "std", error("Invalid message parameter: {parameter}"))]
41 InvalidMessageParameter {
42 parameter: &'static str, },
45
46 #[cfg_attr(feature = "std", error("Unsupported message type: 0x{message:x}"))]
48 UnsupportedMessage {
49 message: u32,
51 },
52
53 #[cfg_attr(feature = "std", error("Required feature not enabled: {feature}"))]
55 FeatureNotEnabled {
56 feature: &'static str,
58 },
59}
60
61pub type WindowsUtilsResult<T> = Result<T, WindowsUtilsError>;