1#![allow(clippy::too_many_arguments)]
7
8#[allow(unused_imports)]
9use std::borrow::Cow;
10#[allow(unused_imports)]
11use std::convert::TryInto;
12#[allow(unused_imports)]
13use crate::utils::RawFdContainer;
14#[allow(unused_imports)]
15use crate::x11_utils::{Request, RequestHeader, Serialize, TryParse, TryParseFd};
16use std::io::IoSlice;
17use crate::connection::RequestConnection;
18#[allow(unused_imports)]
19use crate::connection::Connection as X11Connection;
20#[allow(unused_imports)]
21use crate::cookie::{Cookie, CookieWithFds, VoidCookie};
22use crate::errors::ConnectionError;
23#[allow(unused_imports)]
24use crate::errors::ReplyOrIdError;
25use std::future::Future;
26use std::pin::Pin;
27
28pub use x11rb_protocol::protocol::xf86vidmode::*;
29
30async fn major_opcode<Conn: RequestConnection + ?Sized>(conn: &Conn) -> Result<u8, ConnectionError> {
32 let info = conn.extension_information(X11_EXTENSION_NAME).await?;
33 let info = info.ok_or(ConnectionError::UnsupportedExtension)?;
34 Ok(info.major_opcode)
35}
36
37pub async fn query_version<Conn>(conn: &Conn) -> Result<Cookie<'_, Conn, QueryVersionReply>, ConnectionError>
38where
39 Conn: RequestConnection + ?Sized,
40{
41 let request0 = QueryVersionRequest;
42 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
43 let slices = [IoSlice::new(&bytes[0])];
44 assert_eq!(slices.len(), bytes.len());
45 conn.send_request_with_reply(&slices, fds).await
46}
47pub async fn get_mode_line<Conn>(conn: &Conn, screen: u16) -> Result<Cookie<'_, Conn, GetModeLineReply>, ConnectionError>
48where
49 Conn: RequestConnection + ?Sized,
50{
51 let request0 = GetModeLineRequest {
52 screen,
53 };
54 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
55 let slices = [IoSlice::new(&bytes[0])];
56 assert_eq!(slices.len(), bytes.len());
57 conn.send_request_with_reply(&slices, fds).await
58}
59pub async fn mod_mode_line<'c, 'input, Conn>(conn: &'c Conn, screen: u32, hdisplay: u16, hsyncstart: u16, hsyncend: u16, htotal: u16, hskew: u16, vdisplay: u16, vsyncstart: u16, vsyncend: u16, vtotal: u16, flags: ModeFlag, private: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
60where
61 Conn: RequestConnection + ?Sized,
62{
63 let request0 = ModModeLineRequest {
64 screen,
65 hdisplay,
66 hsyncstart,
67 hsyncend,
68 htotal,
69 hskew,
70 vdisplay,
71 vsyncstart,
72 vsyncend,
73 vtotal,
74 flags,
75 private: Cow::Borrowed(private),
76 };
77 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
78 let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
79 assert_eq!(slices.len(), bytes.len());
80 conn.send_request_without_reply(&slices, fds).await
81}
82pub async fn switch_mode<Conn>(conn: &Conn, screen: u16, zoom: u16) -> Result<VoidCookie<'_, Conn>, ConnectionError>
83where
84 Conn: RequestConnection + ?Sized,
85{
86 let request0 = SwitchModeRequest {
87 screen,
88 zoom,
89 };
90 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
91 let slices = [IoSlice::new(&bytes[0])];
92 assert_eq!(slices.len(), bytes.len());
93 conn.send_request_without_reply(&slices, fds).await
94}
95pub async fn get_monitor<Conn>(conn: &Conn, screen: u16) -> Result<Cookie<'_, Conn, GetMonitorReply>, ConnectionError>
96where
97 Conn: RequestConnection + ?Sized,
98{
99 let request0 = GetMonitorRequest {
100 screen,
101 };
102 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
103 let slices = [IoSlice::new(&bytes[0])];
104 assert_eq!(slices.len(), bytes.len());
105 conn.send_request_with_reply(&slices, fds).await
106}
107pub async fn lock_mode_switch<Conn>(conn: &Conn, screen: u16, lock: u16) -> Result<VoidCookie<'_, Conn>, ConnectionError>
108where
109 Conn: RequestConnection + ?Sized,
110{
111 let request0 = LockModeSwitchRequest {
112 screen,
113 lock,
114 };
115 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
116 let slices = [IoSlice::new(&bytes[0])];
117 assert_eq!(slices.len(), bytes.len());
118 conn.send_request_without_reply(&slices, fds).await
119}
120pub async fn get_all_mode_lines<Conn>(conn: &Conn, screen: u16) -> Result<Cookie<'_, Conn, GetAllModeLinesReply>, ConnectionError>
121where
122 Conn: RequestConnection + ?Sized,
123{
124 let request0 = GetAllModeLinesRequest {
125 screen,
126 };
127 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
128 let slices = [IoSlice::new(&bytes[0])];
129 assert_eq!(slices.len(), bytes.len());
130 conn.send_request_with_reply(&slices, fds).await
131}
132pub async fn add_mode_line<'c, 'input, Conn>(conn: &'c Conn, screen: u32, dotclock: Dotclock, hdisplay: u16, hsyncstart: u16, hsyncend: u16, htotal: u16, hskew: u16, vdisplay: u16, vsyncstart: u16, vsyncend: u16, vtotal: u16, flags: ModeFlag, after_dotclock: Dotclock, after_hdisplay: u16, after_hsyncstart: u16, after_hsyncend: u16, after_htotal: u16, after_hskew: u16, after_vdisplay: u16, after_vsyncstart: u16, after_vsyncend: u16, after_vtotal: u16, after_flags: ModeFlag, private: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
133where
134 Conn: RequestConnection + ?Sized,
135{
136 let request0 = AddModeLineRequest {
137 screen,
138 dotclock,
139 hdisplay,
140 hsyncstart,
141 hsyncend,
142 htotal,
143 hskew,
144 vdisplay,
145 vsyncstart,
146 vsyncend,
147 vtotal,
148 flags,
149 after_dotclock,
150 after_hdisplay,
151 after_hsyncstart,
152 after_hsyncend,
153 after_htotal,
154 after_hskew,
155 after_vdisplay,
156 after_vsyncstart,
157 after_vsyncend,
158 after_vtotal,
159 after_flags,
160 private: Cow::Borrowed(private),
161 };
162 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
163 let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
164 assert_eq!(slices.len(), bytes.len());
165 conn.send_request_without_reply(&slices, fds).await
166}
167pub async fn delete_mode_line<'c, 'input, Conn>(conn: &'c Conn, screen: u32, dotclock: Dotclock, hdisplay: u16, hsyncstart: u16, hsyncend: u16, htotal: u16, hskew: u16, vdisplay: u16, vsyncstart: u16, vsyncend: u16, vtotal: u16, flags: ModeFlag, private: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
168where
169 Conn: RequestConnection + ?Sized,
170{
171 let request0 = DeleteModeLineRequest {
172 screen,
173 dotclock,
174 hdisplay,
175 hsyncstart,
176 hsyncend,
177 htotal,
178 hskew,
179 vdisplay,
180 vsyncstart,
181 vsyncend,
182 vtotal,
183 flags,
184 private: Cow::Borrowed(private),
185 };
186 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
187 let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
188 assert_eq!(slices.len(), bytes.len());
189 conn.send_request_without_reply(&slices, fds).await
190}
191pub async fn validate_mode_line<'c, 'input, Conn>(conn: &'c Conn, screen: u32, dotclock: Dotclock, hdisplay: u16, hsyncstart: u16, hsyncend: u16, htotal: u16, hskew: u16, vdisplay: u16, vsyncstart: u16, vsyncend: u16, vtotal: u16, flags: ModeFlag, private: &'input [u8]) -> Result<Cookie<'c, Conn, ValidateModeLineReply>, ConnectionError>
192where
193 Conn: RequestConnection + ?Sized,
194{
195 let request0 = ValidateModeLineRequest {
196 screen,
197 dotclock,
198 hdisplay,
199 hsyncstart,
200 hsyncend,
201 htotal,
202 hskew,
203 vdisplay,
204 vsyncstart,
205 vsyncend,
206 vtotal,
207 flags,
208 private: Cow::Borrowed(private),
209 };
210 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
211 let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
212 assert_eq!(slices.len(), bytes.len());
213 conn.send_request_with_reply(&slices, fds).await
214}
215pub async fn switch_to_mode<'c, 'input, Conn>(conn: &'c Conn, screen: u32, dotclock: Dotclock, hdisplay: u16, hsyncstart: u16, hsyncend: u16, htotal: u16, hskew: u16, vdisplay: u16, vsyncstart: u16, vsyncend: u16, vtotal: u16, flags: ModeFlag, private: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
216where
217 Conn: RequestConnection + ?Sized,
218{
219 let request0 = SwitchToModeRequest {
220 screen,
221 dotclock,
222 hdisplay,
223 hsyncstart,
224 hsyncend,
225 htotal,
226 hskew,
227 vdisplay,
228 vsyncstart,
229 vsyncend,
230 vtotal,
231 flags,
232 private: Cow::Borrowed(private),
233 };
234 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
235 let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
236 assert_eq!(slices.len(), bytes.len());
237 conn.send_request_without_reply(&slices, fds).await
238}
239pub async fn get_view_port<Conn>(conn: &Conn, screen: u16) -> Result<Cookie<'_, Conn, GetViewPortReply>, ConnectionError>
240where
241 Conn: RequestConnection + ?Sized,
242{
243 let request0 = GetViewPortRequest {
244 screen,
245 };
246 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
247 let slices = [IoSlice::new(&bytes[0])];
248 assert_eq!(slices.len(), bytes.len());
249 conn.send_request_with_reply(&slices, fds).await
250}
251pub async fn set_view_port<Conn>(conn: &Conn, screen: u16, x: u32, y: u32) -> Result<VoidCookie<'_, Conn>, ConnectionError>
252where
253 Conn: RequestConnection + ?Sized,
254{
255 let request0 = SetViewPortRequest {
256 screen,
257 x,
258 y,
259 };
260 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
261 let slices = [IoSlice::new(&bytes[0])];
262 assert_eq!(slices.len(), bytes.len());
263 conn.send_request_without_reply(&slices, fds).await
264}
265pub async fn get_dot_clocks<Conn>(conn: &Conn, screen: u16) -> Result<Cookie<'_, Conn, GetDotClocksReply>, ConnectionError>
266where
267 Conn: RequestConnection + ?Sized,
268{
269 let request0 = GetDotClocksRequest {
270 screen,
271 };
272 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
273 let slices = [IoSlice::new(&bytes[0])];
274 assert_eq!(slices.len(), bytes.len());
275 conn.send_request_with_reply(&slices, fds).await
276}
277pub async fn set_client_version<Conn>(conn: &Conn, major: u16, minor: u16) -> Result<VoidCookie<'_, Conn>, ConnectionError>
278where
279 Conn: RequestConnection + ?Sized,
280{
281 let request0 = SetClientVersionRequest {
282 major,
283 minor,
284 };
285 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
286 let slices = [IoSlice::new(&bytes[0])];
287 assert_eq!(slices.len(), bytes.len());
288 conn.send_request_without_reply(&slices, fds).await
289}
290pub async fn set_gamma<Conn>(conn: &Conn, screen: u16, red: u32, green: u32, blue: u32) -> Result<VoidCookie<'_, Conn>, ConnectionError>
291where
292 Conn: RequestConnection + ?Sized,
293{
294 let request0 = SetGammaRequest {
295 screen,
296 red,
297 green,
298 blue,
299 };
300 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
301 let slices = [IoSlice::new(&bytes[0])];
302 assert_eq!(slices.len(), bytes.len());
303 conn.send_request_without_reply(&slices, fds).await
304}
305pub async fn get_gamma<Conn>(conn: &Conn, screen: u16) -> Result<Cookie<'_, Conn, GetGammaReply>, ConnectionError>
306where
307 Conn: RequestConnection + ?Sized,
308{
309 let request0 = GetGammaRequest {
310 screen,
311 };
312 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
313 let slices = [IoSlice::new(&bytes[0])];
314 assert_eq!(slices.len(), bytes.len());
315 conn.send_request_with_reply(&slices, fds).await
316}
317pub async fn get_gamma_ramp<Conn>(conn: &Conn, screen: u16, size: u16) -> Result<Cookie<'_, Conn, GetGammaRampReply>, ConnectionError>
318where
319 Conn: RequestConnection + ?Sized,
320{
321 let request0 = GetGammaRampRequest {
322 screen,
323 size,
324 };
325 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
326 let slices = [IoSlice::new(&bytes[0])];
327 assert_eq!(slices.len(), bytes.len());
328 conn.send_request_with_reply(&slices, fds).await
329}
330pub async fn set_gamma_ramp<'c, 'input, Conn>(conn: &'c Conn, screen: u16, size: u16, red: &'input [u16], green: &'input [u16], blue: &'input [u16]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
331where
332 Conn: RequestConnection + ?Sized,
333{
334 let request0 = SetGammaRampRequest {
335 screen,
336 size,
337 red: Cow::Borrowed(red),
338 green: Cow::Borrowed(green),
339 blue: Cow::Borrowed(blue),
340 };
341 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
342 let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2]), IoSlice::new(&bytes[3]), IoSlice::new(&bytes[4])];
343 assert_eq!(slices.len(), bytes.len());
344 conn.send_request_without_reply(&slices, fds).await
345}
346pub async fn get_gamma_ramp_size<Conn>(conn: &Conn, screen: u16) -> Result<Cookie<'_, Conn, GetGammaRampSizeReply>, ConnectionError>
347where
348 Conn: RequestConnection + ?Sized,
349{
350 let request0 = GetGammaRampSizeRequest {
351 screen,
352 };
353 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
354 let slices = [IoSlice::new(&bytes[0])];
355 assert_eq!(slices.len(), bytes.len());
356 conn.send_request_with_reply(&slices, fds).await
357}
358pub async fn get_permissions<Conn>(conn: &Conn, screen: u16) -> Result<Cookie<'_, Conn, GetPermissionsReply>, ConnectionError>
359where
360 Conn: RequestConnection + ?Sized,
361{
362 let request0 = GetPermissionsRequest {
363 screen,
364 };
365 let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
366 let slices = [IoSlice::new(&bytes[0])];
367 assert_eq!(slices.len(), bytes.len());
368 conn.send_request_with_reply(&slices, fds).await
369}
370pub trait ConnectionExt: RequestConnection {
372 fn xf86vidmode_query_version(&self) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, QueryVersionReply>, ConnectionError>> + Send + '_>>
373 {
374 Box::pin(query_version(self))
375 }
376 fn xf86vidmode_get_mode_line(&self, screen: u16) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetModeLineReply>, ConnectionError>> + Send + '_>>
377 {
378 Box::pin(get_mode_line(self, screen))
379 }
380 fn xf86vidmode_mod_mode_line<'c, 'input, 'future>(&'c self, screen: u32, hdisplay: u16, hsyncstart: u16, hsyncend: u16, htotal: u16, hskew: u16, vdisplay: u16, vsyncstart: u16, vsyncend: u16, vtotal: u16, flags: ModeFlag, private: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
381 where
382 'c: 'future,
383 'input: 'future,
384 {
385 Box::pin(mod_mode_line(self, screen, hdisplay, hsyncstart, hsyncend, htotal, hskew, vdisplay, vsyncstart, vsyncend, vtotal, flags, private))
386 }
387 fn xf86vidmode_switch_mode(&self, screen: u16, zoom: u16) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
388 {
389 Box::pin(switch_mode(self, screen, zoom))
390 }
391 fn xf86vidmode_get_monitor(&self, screen: u16) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetMonitorReply>, ConnectionError>> + Send + '_>>
392 {
393 Box::pin(get_monitor(self, screen))
394 }
395 fn xf86vidmode_lock_mode_switch(&self, screen: u16, lock: u16) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
396 {
397 Box::pin(lock_mode_switch(self, screen, lock))
398 }
399 fn xf86vidmode_get_all_mode_lines(&self, screen: u16) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetAllModeLinesReply>, ConnectionError>> + Send + '_>>
400 {
401 Box::pin(get_all_mode_lines(self, screen))
402 }
403 fn xf86vidmode_add_mode_line<'c, 'input, 'future>(&'c self, screen: u32, dotclock: Dotclock, hdisplay: u16, hsyncstart: u16, hsyncend: u16, htotal: u16, hskew: u16, vdisplay: u16, vsyncstart: u16, vsyncend: u16, vtotal: u16, flags: ModeFlag, after_dotclock: Dotclock, after_hdisplay: u16, after_hsyncstart: u16, after_hsyncend: u16, after_htotal: u16, after_hskew: u16, after_vdisplay: u16, after_vsyncstart: u16, after_vsyncend: u16, after_vtotal: u16, after_flags: ModeFlag, private: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
404 where
405 'c: 'future,
406 'input: 'future,
407 {
408 Box::pin(add_mode_line(self, screen, dotclock, hdisplay, hsyncstart, hsyncend, htotal, hskew, vdisplay, vsyncstart, vsyncend, vtotal, flags, after_dotclock, after_hdisplay, after_hsyncstart, after_hsyncend, after_htotal, after_hskew, after_vdisplay, after_vsyncstart, after_vsyncend, after_vtotal, after_flags, private))
409 }
410 fn xf86vidmode_delete_mode_line<'c, 'input, 'future>(&'c self, screen: u32, dotclock: Dotclock, hdisplay: u16, hsyncstart: u16, hsyncend: u16, htotal: u16, hskew: u16, vdisplay: u16, vsyncstart: u16, vsyncend: u16, vtotal: u16, flags: ModeFlag, private: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
411 where
412 'c: 'future,
413 'input: 'future,
414 {
415 Box::pin(delete_mode_line(self, screen, dotclock, hdisplay, hsyncstart, hsyncend, htotal, hskew, vdisplay, vsyncstart, vsyncend, vtotal, flags, private))
416 }
417 fn xf86vidmode_validate_mode_line<'c, 'input, 'future>(&'c self, screen: u32, dotclock: Dotclock, hdisplay: u16, hsyncstart: u16, hsyncend: u16, htotal: u16, hskew: u16, vdisplay: u16, vsyncstart: u16, vsyncend: u16, vtotal: u16, flags: ModeFlag, private: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<Cookie<'c, Self, ValidateModeLineReply>, ConnectionError>> + Send + 'future>>
418 where
419 'c: 'future,
420 'input: 'future,
421 {
422 Box::pin(validate_mode_line(self, screen, dotclock, hdisplay, hsyncstart, hsyncend, htotal, hskew, vdisplay, vsyncstart, vsyncend, vtotal, flags, private))
423 }
424 fn xf86vidmode_switch_to_mode<'c, 'input, 'future>(&'c self, screen: u32, dotclock: Dotclock, hdisplay: u16, hsyncstart: u16, hsyncend: u16, htotal: u16, hskew: u16, vdisplay: u16, vsyncstart: u16, vsyncend: u16, vtotal: u16, flags: ModeFlag, private: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
425 where
426 'c: 'future,
427 'input: 'future,
428 {
429 Box::pin(switch_to_mode(self, screen, dotclock, hdisplay, hsyncstart, hsyncend, htotal, hskew, vdisplay, vsyncstart, vsyncend, vtotal, flags, private))
430 }
431 fn xf86vidmode_get_view_port(&self, screen: u16) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetViewPortReply>, ConnectionError>> + Send + '_>>
432 {
433 Box::pin(get_view_port(self, screen))
434 }
435 fn xf86vidmode_set_view_port(&self, screen: u16, x: u32, y: u32) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
436 {
437 Box::pin(set_view_port(self, screen, x, y))
438 }
439 fn xf86vidmode_get_dot_clocks(&self, screen: u16) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetDotClocksReply>, ConnectionError>> + Send + '_>>
440 {
441 Box::pin(get_dot_clocks(self, screen))
442 }
443 fn xf86vidmode_set_client_version(&self, major: u16, minor: u16) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
444 {
445 Box::pin(set_client_version(self, major, minor))
446 }
447 fn xf86vidmode_set_gamma(&self, screen: u16, red: u32, green: u32, blue: u32) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
448 {
449 Box::pin(set_gamma(self, screen, red, green, blue))
450 }
451 fn xf86vidmode_get_gamma(&self, screen: u16) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetGammaReply>, ConnectionError>> + Send + '_>>
452 {
453 Box::pin(get_gamma(self, screen))
454 }
455 fn xf86vidmode_get_gamma_ramp(&self, screen: u16, size: u16) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetGammaRampReply>, ConnectionError>> + Send + '_>>
456 {
457 Box::pin(get_gamma_ramp(self, screen, size))
458 }
459 fn xf86vidmode_set_gamma_ramp<'c, 'input, 'future>(&'c self, screen: u16, size: u16, red: &'input [u16], green: &'input [u16], blue: &'input [u16]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
460 where
461 'c: 'future,
462 'input: 'future,
463 {
464 Box::pin(set_gamma_ramp(self, screen, size, red, green, blue))
465 }
466 fn xf86vidmode_get_gamma_ramp_size(&self, screen: u16) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetGammaRampSizeReply>, ConnectionError>> + Send + '_>>
467 {
468 Box::pin(get_gamma_ramp_size(self, screen))
469 }
470 fn xf86vidmode_get_permissions(&self, screen: u16) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetPermissionsReply>, ConnectionError>> + Send + '_>>
471 {
472 Box::pin(get_permissions(self, screen))
473 }
474}
475
476impl<C: RequestConnection + ?Sized> ConnectionExt for C {}