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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
//! Centralized error types for the `df_displmgr` crate.
//!
//! All display-management operations return [`DisplayError`] variants, ensuring
//! callers can match on precise failure modes without resorting to string
//! inspection or `anyhow` erasure.
//!
//! # Platform Parity
//!
//! The [`UnsupportedPlatform`](DisplayError::UnsupportedPlatform) variant
//! guarantees that the public API surface is **100% identical** across Windows
//! and Linux: if a feature is physically impossible on one platform (e.g., HDR
//! metadata over DDC on a bare-metal DRM session), it returns this typed error
//! rather than omitting the method or changing the signature.
use Error;
use crateDisplayId;
/// Central error type for all display management operations.
///
/// Every public API in this crate returns `Result<T, DisplayError>` so that
/// callers can handle failures via exhaustive pattern matching. Backend
/// implementations wrap platform-specific errors into the appropriate variant.
///
/// # Variant Summary
///
/// | Variant | Meaning |
/// |---------|---------|
/// | [`ConnectionFailed`](DisplayError::ConnectionFailed) | Subsystem unreachable |
/// | [`NotFound`](DisplayError::NotFound) | Output missing |
/// | [`ConfigurationRejected`](DisplayError::ConfigurationRejected) | HW rejected settings |
/// | [`HdrError`](DisplayError::HdrError) | HDR operation failure |
/// | [`UnsupportedFeature`](DisplayError::UnsupportedFeature) | Feature not implemented |
/// | [`UnsupportedHardware`](DisplayError::UnsupportedHardware) | HW lacks capability |
/// | [`UnsupportedPlatform`](DisplayError::UnsupportedPlatform) | Feature impossible on OS |
/// | [`BackendError`](DisplayError::BackendError) | Raw platform error |
/// | [`OutputDisabled`](DisplayError::OutputDisabled) | Output is off |
/// | [`StaleTopology`](DisplayError::StaleTopology) | Need re-acquire |
/// | [`PermissionDenied`](DisplayError::PermissionDenied) | Missing privileges |
/// | [`Timeout`](DisplayError::Timeout) | Operation timed out |
/// | [`Serialization`](DisplayError::Serialization) | Parse/encode failure |
/// | [`Io`](DisplayError::Io) | I/O subsystem error |
///
/// # Examples
///
/// ```rust
/// use df_displmgr::error::DisplayError;
///
/// let err = DisplayError::NotFound(df_displmgr::DisplayId("HDMI-1".into()));
/// assert!(err.to_string().contains("not found"));
/// ```
/// Specialized [`Result`] type for display operations.
///
/// This is the canonical return type used throughout the crate. Every public
/// API function returns `DisplayResult<T>` so that callers can operate on a
/// single, unified error type.
///
/// # Example
///
/// ```rust
/// use df_displmgr::{DisplayResult, DisplayId, NativeTopology};
/// use df_displmgr::traits::UniversalTopology;
///
/// fn example() -> DisplayResult<()> {
/// let topo = NativeTopology::acquire()?;
/// println!("Detected {} outputs", topo.get_outputs().len());
/// Ok(())
/// }
/// ```
pub type DisplayResult<T> = ;