• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use crate::backend;
2 #[cfg(not(any(
3     target_os = "dragonfly",
4     target_os = "freebsd",
5     target_os = "haiku",
6     target_os = "ios",
7     target_os = "macos",
8     target_os = "netbsd",
9     target_os = "openbsd",
10     target_os = "solaris",
11 )))]
12 pub use backend::termios::types::B1000000;
13 #[cfg(not(any(
14     target_os = "dragonfly",
15     target_os = "freebsd",
16     target_os = "haiku",
17     target_os = "ios",
18     target_os = "macos",
19     target_os = "netbsd",
20     target_os = "openbsd",
21     target_os = "solaris",
22 )))]
23 pub use backend::termios::types::B1152000;
24 #[cfg(not(any(
25     target_os = "dragonfly",
26     target_os = "freebsd",
27     target_os = "haiku",
28     target_os = "ios",
29     target_os = "macos",
30     target_os = "netbsd",
31     target_os = "openbsd",
32     target_os = "solaris",
33 )))]
34 pub use backend::termios::types::B1500000;
35 #[cfg(not(any(
36     target_os = "dragonfly",
37     target_os = "freebsd",
38     target_os = "haiku",
39     target_os = "ios",
40     target_os = "macos",
41     target_os = "netbsd",
42     target_os = "openbsd",
43     target_os = "solaris",
44 )))]
45 pub use backend::termios::types::B2000000;
46 #[cfg(not(any(
47     target_arch = "sparc",
48     target_arch = "sparc64",
49     target_os = "dragonfly",
50     target_os = "freebsd",
51     target_os = "haiku",
52     target_os = "ios",
53     target_os = "macos",
54     target_os = "netbsd",
55     target_os = "openbsd",
56     target_os = "solaris",
57 )))]
58 pub use backend::termios::types::B2500000;
59 #[cfg(not(any(
60     target_arch = "sparc",
61     target_arch = "sparc64",
62     target_os = "dragonfly",
63     target_os = "freebsd",
64     target_os = "haiku",
65     target_os = "ios",
66     target_os = "macos",
67     target_os = "netbsd",
68     target_os = "openbsd",
69     target_os = "solaris",
70 )))]
71 pub use backend::termios::types::B3000000;
72 #[cfg(not(any(
73     target_arch = "sparc",
74     target_arch = "sparc64",
75     target_os = "dragonfly",
76     target_os = "freebsd",
77     target_os = "haiku",
78     target_os = "ios",
79     target_os = "macos",
80     target_os = "netbsd",
81     target_os = "openbsd",
82     target_os = "solaris",
83 )))]
84 pub use backend::termios::types::B3500000;
85 #[cfg(not(any(
86     target_arch = "sparc",
87     target_arch = "sparc64",
88     target_os = "dragonfly",
89     target_os = "freebsd",
90     target_os = "haiku",
91     target_os = "ios",
92     target_os = "macos",
93     target_os = "netbsd",
94     target_os = "openbsd",
95     target_os = "solaris",
96 )))]
97 pub use backend::termios::types::B4000000;
98 #[cfg(not(any(
99     target_os = "dragonfly",
100     target_os = "haiku",
101     target_os = "ios",
102     target_os = "macos",
103     target_os = "openbsd"
104 )))]
105 pub use backend::termios::types::B460800;
106 #[cfg(not(any(
107     target_os = "dragonfly",
108     target_os = "freebsd",
109     target_os = "haiku",
110     target_os = "illumos",
111     target_os = "ios",
112     target_os = "macos",
113     target_os = "netbsd",
114     target_os = "openbsd",
115     target_os = "solaris",
116 )))]
117 pub use backend::termios::types::B500000;
118 #[cfg(not(any(
119     target_os = "dragonfly",
120     target_os = "freebsd",
121     target_os = "haiku",
122     target_os = "illumos",
123     target_os = "ios",
124     target_os = "macos",
125     target_os = "netbsd",
126     target_os = "openbsd",
127     target_os = "solaris",
128 )))]
129 pub use backend::termios::types::B576000;
130 #[cfg(not(any(
131     target_os = "dragonfly",
132     target_os = "haiku",
133     target_os = "ios",
134     target_os = "macos",
135     target_os = "openbsd"
136 )))]
137 pub use backend::termios::types::B921600;
138 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
139 pub use backend::termios::types::BRKINT;
140 #[cfg(not(any(
141     target_os = "dragonfly",
142     target_os = "freebsd",
143     target_os = "fuchsia",
144     target_os = "illumos",
145     target_os = "ios",
146     target_os = "macos",
147     target_os = "netbsd",
148     target_os = "openbsd",
149     target_os = "redox",
150     target_os = "solaris",
151 )))]
152 pub use backend::termios::types::BS0;
153 #[cfg(not(any(
154     all(libc, target_env = "musl"),
155     target_os = "dragonfly",
156     target_os = "emscripten",
157     target_os = "freebsd",
158     target_os = "fuchsia",
159     target_os = "illumos",
160     target_os = "ios",
161     target_os = "macos",
162     target_os = "netbsd",
163     target_os = "openbsd",
164     target_os = "redox",
165     target_os = "solaris",
166 )))]
167 pub use backend::termios::types::BS1;
168 #[cfg(not(any(
169     target_os = "dragonfly",
170     target_os = "freebsd",
171     target_os = "illumos",
172     target_os = "ios",
173     target_os = "macos",
174     target_os = "netbsd",
175     target_os = "openbsd",
176     target_os = "redox",
177     target_os = "solaris",
178 )))]
179 pub use backend::termios::types::BSDLY;
180 #[cfg(not(any(
181     target_os = "dragonfly",
182     target_os = "freebsd",
183     target_os = "haiku",
184     target_os = "ios",
185     target_os = "macos",
186     target_os = "netbsd",
187     target_os = "openbsd",
188     target_os = "redox",
189 )))]
190 pub use backend::termios::types::CBAUD;
191 #[cfg(not(any(
192     target_os = "dragonfly",
193     target_os = "freebsd",
194     target_os = "haiku",
195     target_os = "illumos",
196     target_os = "ios",
197     target_os = "macos",
198     target_os = "netbsd",
199     target_os = "openbsd",
200     target_os = "redox",
201     target_os = "solaris",
202 )))]
203 pub use backend::termios::types::CBAUDEX;
204 #[cfg(not(any(
205     target_os = "dragonfly",
206     target_os = "emscripten",
207     target_os = "freebsd",
208     target_os = "haiku",
209     target_os = "ios",
210     target_os = "macos",
211     target_os = "netbsd",
212     target_os = "openbsd",
213     target_os = "redox",
214 )))]
215 pub use backend::termios::types::CIBAUD;
216 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
217 pub use backend::termios::types::CLOCAL;
218 #[cfg(not(any(
219     target_os = "dragonfly",
220     target_os = "emscripten",
221     target_os = "freebsd",
222     target_os = "haiku",
223     target_os = "illumos",
224     target_os = "ios",
225     target_os = "macos",
226     target_os = "netbsd",
227     target_os = "openbsd",
228     target_os = "redox",
229     target_os = "solaris",
230 )))]
231 pub use backend::termios::types::CMSPAR;
232 #[cfg(not(any(
233     target_os = "dragonfly",
234     target_os = "freebsd",
235     target_os = "fuchsia",
236     target_os = "illumos",
237     target_os = "ios",
238     target_os = "macos",
239     target_os = "netbsd",
240     target_os = "openbsd",
241     target_os = "redox",
242     target_os = "solaris",
243 )))]
244 pub use backend::termios::types::CR0;
245 #[cfg(not(any(
246     all(libc, target_env = "musl"),
247     target_os = "dragonfly",
248     target_os = "emscripten",
249     target_os = "freebsd",
250     target_os = "fuchsia",
251     target_os = "illumos",
252     target_os = "ios",
253     target_os = "macos",
254     target_os = "netbsd",
255     target_os = "openbsd",
256     target_os = "redox",
257     target_os = "solaris",
258 )))]
259 pub use backend::termios::types::CR1;
260 #[cfg(not(any(
261     all(libc, target_env = "musl"),
262     target_os = "dragonfly",
263     target_os = "emscripten",
264     target_os = "freebsd",
265     target_os = "fuchsia",
266     target_os = "illumos",
267     target_os = "ios",
268     target_os = "macos",
269     target_os = "netbsd",
270     target_os = "openbsd",
271     target_os = "redox",
272     target_os = "solaris",
273 )))]
274 pub use backend::termios::types::CR2;
275 #[cfg(not(any(
276     all(libc, target_env = "musl"),
277     target_os = "dragonfly",
278     target_os = "emscripten",
279     target_os = "freebsd",
280     target_os = "fuchsia",
281     target_os = "illumos",
282     target_os = "ios",
283     target_os = "macos",
284     target_os = "netbsd",
285     target_os = "openbsd",
286     target_os = "redox",
287     target_os = "solaris",
288 )))]
289 pub use backend::termios::types::CR3;
290 #[cfg(not(any(
291     target_os = "dragonfly",
292     target_os = "freebsd",
293     target_os = "illumos",
294     target_os = "ios",
295     target_os = "macos",
296     target_os = "netbsd",
297     target_os = "openbsd",
298     target_os = "redox",
299     target_os = "solaris",
300 )))]
301 pub use backend::termios::types::CRDLY;
302 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
303 pub use backend::termios::types::CREAD;
304 #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
305 pub use backend::termios::types::CRTSCTS;
306 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
307 pub use backend::termios::types::CS5;
308 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
309 pub use backend::termios::types::CS6;
310 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
311 pub use backend::termios::types::CS7;
312 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
313 pub use backend::termios::types::CS8;
314 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
315 pub use backend::termios::types::CSIZE;
316 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
317 pub use backend::termios::types::CSTOPB;
318 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
319 pub use backend::termios::types::ECHO;
320 #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
321 pub use backend::termios::types::ECHOCTL;
322 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
323 pub use backend::termios::types::ECHOE;
324 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
325 pub use backend::termios::types::ECHOK;
326 #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
327 pub use backend::termios::types::ECHOKE;
328 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
329 pub use backend::termios::types::ECHONL;
330 #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
331 pub use backend::termios::types::ECHOPRT;
332 #[cfg(not(any(
333     target_os = "emscripten",
334     target_os = "haiku",
335     target_os = "illumos",
336     target_os = "ios",
337     target_os = "macos",
338     target_os = "redox",
339     target_os = "solaris",
340 )))]
341 pub use backend::termios::types::EXTA;
342 #[cfg(not(any(
343     target_os = "emscripten",
344     target_os = "haiku",
345     target_os = "illumos",
346     target_os = "ios",
347     target_os = "macos",
348     target_os = "redox",
349     target_os = "solaris",
350 )))]
351 pub use backend::termios::types::EXTB;
352 #[cfg(not(any(
353     target_os = "haiku",
354     target_os = "ios",
355     target_os = "macos",
356     target_os = "redox"
357 )))]
358 pub use backend::termios::types::EXTPROC;
359 #[cfg(not(any(
360     target_os = "dragonfly",
361     target_os = "freebsd",
362     target_os = "fuchsia",
363     target_os = "illumos",
364     target_os = "ios",
365     target_os = "macos",
366     target_os = "netbsd",
367     target_os = "openbsd",
368     target_os = "redox",
369     target_os = "solaris",
370 )))]
371 pub use backend::termios::types::FF0;
372 #[cfg(not(any(
373     all(libc, target_env = "musl"),
374     target_os = "dragonfly",
375     target_os = "emscripten",
376     target_os = "freebsd",
377     target_os = "fuchsia",
378     target_os = "illumos",
379     target_os = "ios",
380     target_os = "macos",
381     target_os = "netbsd",
382     target_os = "openbsd",
383     target_os = "redox",
384     target_os = "solaris",
385 )))]
386 pub use backend::termios::types::FF1;
387 #[cfg(not(any(
388     all(libc, target_env = "musl"),
389     target_os = "dragonfly",
390     target_os = "freebsd",
391     target_os = "illumos",
392     target_os = "ios",
393     target_os = "macos",
394     target_os = "netbsd",
395     target_os = "openbsd",
396     target_os = "redox",
397     target_os = "solaris",
398 )))]
399 pub use backend::termios::types::FFDLY;
400 #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
401 pub use backend::termios::types::FLUSHO;
402 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
403 pub use backend::termios::types::HUPCL;
404 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
405 pub use backend::termios::types::ICRNL;
406 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
407 pub use backend::termios::types::IEXTEN;
408 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
409 pub use backend::termios::types::IGNBRK;
410 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
411 pub use backend::termios::types::IGNCR;
412 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
413 pub use backend::termios::types::IGNPAR;
414 #[cfg(not(any(
415     target_os = "haiku",
416     target_os = "ios",
417     target_os = "macos",
418     target_os = "redox"
419 )))]
420 pub use backend::termios::types::IMAXBEL;
421 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
422 pub use backend::termios::types::INLCR;
423 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
424 pub use backend::termios::types::INPCK;
425 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
426 pub use backend::termios::types::ISIG;
427 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
428 pub use backend::termios::types::ISTRIP;
429 #[cfg(any(
430     linux_raw,
431     all(
432         libc,
433         any(target_os = "haiku", target_os = "illumos", target_os = "solaris"),
434     )
435 ))]
436 pub use backend::termios::types::IUCLC;
437 #[cfg(not(any(
438     target_os = "dragonfly",
439     target_os = "emscripten",
440     target_os = "freebsd",
441     target_os = "haiku",
442     target_os = "illumos",
443     target_os = "ios",
444     target_os = "macos",
445     target_os = "netbsd",
446     target_os = "openbsd",
447     target_os = "redox",
448     target_os = "solaris",
449 )))]
450 pub use backend::termios::types::IUTF8;
451 #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
452 pub use backend::termios::types::IXANY;
453 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
454 pub use backend::termios::types::IXOFF;
455 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
456 pub use backend::termios::types::IXON;
457 #[cfg(not(any(
458     target_os = "dragonfly",
459     target_os = "freebsd",
460     target_os = "fuchsia",
461     target_os = "illumos",
462     target_os = "ios",
463     target_os = "macos",
464     target_os = "netbsd",
465     target_os = "openbsd",
466     target_os = "redox",
467     target_os = "solaris",
468 )))]
469 pub use backend::termios::types::NL0;
470 #[cfg(not(any(
471     target_os = "dragonfly",
472     target_os = "freebsd",
473     target_os = "fuchsia",
474     target_os = "illumos",
475     target_os = "ios",
476     target_os = "macos",
477     target_os = "netbsd",
478     target_os = "openbsd",
479     target_os = "redox",
480     target_os = "solaris",
481 )))]
482 pub use backend::termios::types::NL1;
483 #[cfg(not(any(
484     target_os = "dragonfly",
485     target_os = "freebsd",
486     target_os = "illumos",
487     target_os = "ios",
488     target_os = "macos",
489     target_os = "netbsd",
490     target_os = "openbsd",
491     target_os = "redox",
492     target_os = "solaris",
493 )))]
494 pub use backend::termios::types::NLDLY;
495 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
496 pub use backend::termios::types::NOFLSH;
497 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
498 pub use backend::termios::types::OCRNL;
499 #[cfg(not(any(
500     target_os = "dragonfly",
501     target_os = "freebsd",
502     target_os = "ios",
503     target_os = "macos",
504     target_os = "netbsd",
505     target_os = "openbsd",
506 )))]
507 pub use backend::termios::types::OFDEL;
508 #[cfg(not(any(
509     target_os = "dragonfly",
510     target_os = "freebsd",
511     target_os = "ios",
512     target_os = "macos",
513     target_os = "netbsd",
514     target_os = "openbsd",
515 )))]
516 pub use backend::termios::types::OFILL;
517 #[cfg(not(any(
518     target_os = "dragonfly",
519     target_os = "freebsd",
520     target_os = "ios",
521     target_os = "macos",
522     target_os = "netbsd",
523     target_os = "redox",
524 )))]
525 pub use backend::termios::types::OLCUC;
526 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
527 pub use backend::termios::types::ONLCR;
528 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
529 pub use backend::termios::types::ONLRET;
530 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
531 pub use backend::termios::types::ONOCR;
532 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
533 pub use backend::termios::types::OPOST;
534 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
535 pub use backend::termios::types::PARENB;
536 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
537 pub use backend::termios::types::PARMRK;
538 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
539 pub use backend::termios::types::PARODD;
540 #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))]
541 pub use backend::termios::types::PENDIN;
542 #[cfg(not(any(
543     target_os = "dragonfly",
544     target_os = "fuchsia",
545     target_os = "illumos",
546     target_os = "ios",
547     target_os = "macos",
548     target_os = "netbsd",
549     target_os = "openbsd",
550     target_os = "redox",
551     target_os = "solaris",
552 )))]
553 pub use backend::termios::types::TAB0;
554 #[cfg(not(any(
555     all(libc, target_env = "musl"),
556     target_os = "dragonfly",
557     target_os = "emscripten",
558     target_os = "freebsd",
559     target_os = "fuchsia",
560     target_os = "illumos",
561     target_os = "ios",
562     target_os = "macos",
563     target_os = "netbsd",
564     target_os = "openbsd",
565     target_os = "redox",
566     target_os = "solaris",
567 )))]
568 pub use backend::termios::types::TAB1;
569 #[cfg(not(any(
570     all(libc, target_env = "musl"),
571     target_os = "dragonfly",
572     target_os = "emscripten",
573     target_os = "freebsd",
574     target_os = "fuchsia",
575     target_os = "illumos",
576     target_os = "ios",
577     target_os = "macos",
578     target_os = "netbsd",
579     target_os = "openbsd",
580     target_os = "redox",
581     target_os = "solaris",
582 )))]
583 pub use backend::termios::types::TAB2;
584 #[cfg(not(any(
585     all(libc, target_env = "musl"),
586     target_os = "dragonfly",
587     target_os = "emscripten",
588     target_os = "fuchsia",
589     target_os = "illumos",
590     target_os = "ios",
591     target_os = "macos",
592     target_os = "netbsd",
593     target_os = "openbsd",
594     target_os = "redox",
595     target_os = "solaris",
596 )))]
597 pub use backend::termios::types::TAB3;
598 #[cfg(not(any(
599     target_os = "dragonfly",
600     target_os = "ios",
601     target_os = "macos",
602     target_os = "netbsd",
603     target_os = "openbsd",
604     target_os = "illumos",
605     target_os = "redox",
606     target_os = "solaris",
607 )))]
608 pub use backend::termios::types::TABDLY;
609 #[cfg(not(any(target_os = "ios", target_os = "macos")))]
610 pub use backend::termios::types::TOSTOP;
611 #[cfg(not(any(
612     target_os = "dragonfly",
613     target_os = "freebsd",
614     target_os = "haiku",
615     target_os = "illumos",
616     target_os = "ios",
617     target_os = "macos",
618     target_os = "netbsd",
619     target_os = "openbsd",
620     target_os = "solaris",
621 )))]
622 pub use backend::termios::types::VSWTC;
623 #[cfg(not(any(
624     target_os = "dragonfly",
625     target_os = "freebsd",
626     target_os = "fuchsia",
627     target_os = "illumos",
628     target_os = "ios",
629     target_os = "macos",
630     target_os = "netbsd",
631     target_os = "openbsd",
632     target_os = "redox",
633     target_os = "solaris",
634 )))]
635 pub use backend::termios::types::VT0;
636 #[cfg(not(any(
637     all(libc, target_env = "musl"),
638     target_os = "dragonfly",
639     target_os = "emscripten",
640     target_os = "freebsd",
641     target_os = "fuchsia",
642     target_os = "illumos",
643     target_os = "ios",
644     target_os = "macos",
645     target_os = "netbsd",
646     target_os = "openbsd",
647     target_os = "redox",
648     target_os = "solaris",
649 )))]
650 pub use backend::termios::types::VT1;
651 #[cfg(not(any(
652     all(libc, target_env = "musl"),
653     target_os = "dragonfly",
654     target_os = "freebsd",
655     target_os = "illumos",
656     target_os = "ios",
657     target_os = "macos",
658     target_os = "netbsd",
659     target_os = "openbsd",
660     target_os = "redox",
661     target_os = "solaris",
662 )))]
663 pub use backend::termios::types::VTDLY;
664 #[cfg(any(linux_raw, all(libc, any(target_arch = "s390x", target_os = "haiku"))))]
665 pub use backend::termios::types::XCASE;
666 #[cfg(not(any(
667     target_os = "dragonfly",
668     target_os = "freebsd",
669     target_os = "haiku",
670     target_os = "illumos",
671     target_os = "ios",
672     target_os = "macos",
673     target_os = "netbsd",
674     target_os = "openbsd",
675     target_os = "redox",
676     target_os = "solaris",
677 )))]
678 pub use backend::termios::types::XTABS;
679 pub use backend::termios::types::{
680     B0, B110, B115200, B1200, B134, B150, B1800, B19200, B200, B230400, B2400, B300, B38400, B4800,
681     B50, B57600, B600, B75, B9600, ICANON, VEOF, VEOL, VEOL2, VERASE, VINTR, VKILL, VMIN, VQUIT,
682     VSTART, VSTOP, VSUSP, VTIME,
683 };
684 #[cfg(not(target_os = "haiku"))]
685 pub use backend::termios::types::{VDISCARD, VLNEXT, VREPRINT, VWERASE};
686 
687 /// Translate from a `Speed` code to a speed value `u32`.
688 ///
689 /// ```rust
690 /// let speed = rustix::termios::speed_value(rustix::termios::B57600);
691 /// assert_eq!(speed, Some(57600));
692 /// ```
speed_value(speed: backend::termios::types::Speed) -> Option<u32>693 pub fn speed_value(speed: backend::termios::types::Speed) -> Option<u32> {
694     match speed {
695         backend::termios::types::B0 => Some(0),
696         backend::termios::types::B50 => Some(50),
697         backend::termios::types::B75 => Some(75),
698         backend::termios::types::B110 => Some(110),
699         backend::termios::types::B134 => Some(134),
700         backend::termios::types::B150 => Some(150),
701         backend::termios::types::B200 => Some(200),
702         backend::termios::types::B300 => Some(300),
703         backend::termios::types::B600 => Some(600),
704         backend::termios::types::B1200 => Some(1200),
705         backend::termios::types::B1800 => Some(1800),
706         backend::termios::types::B2400 => Some(2400),
707         backend::termios::types::B4800 => Some(4800),
708         backend::termios::types::B9600 => Some(9600),
709         backend::termios::types::B19200 => Some(19200),
710         backend::termios::types::B38400 => Some(38400),
711         backend::termios::types::B57600 => Some(57600),
712         backend::termios::types::B115200 => Some(115_200),
713         backend::termios::types::B230400 => Some(230_400),
714         #[cfg(not(any(
715             target_os = "dragonfly",
716             target_os = "haiku",
717             target_os = "ios",
718             target_os = "macos",
719             target_os = "openbsd"
720         )))]
721         backend::termios::types::B460800 => Some(460_800),
722         #[cfg(not(any(
723             target_os = "dragonfly",
724             target_os = "freebsd",
725             target_os = "haiku",
726             target_os = "illumos",
727             target_os = "ios",
728             target_os = "macos",
729             target_os = "netbsd",
730             target_os = "openbsd",
731             target_os = "solaris",
732         )))]
733         backend::termios::types::B500000 => Some(500_000),
734         #[cfg(not(any(
735             target_os = "dragonfly",
736             target_os = "freebsd",
737             target_os = "haiku",
738             target_os = "illumos",
739             target_os = "ios",
740             target_os = "macos",
741             target_os = "netbsd",
742             target_os = "openbsd",
743             target_os = "solaris",
744         )))]
745         backend::termios::types::B576000 => Some(576_000),
746         #[cfg(not(any(
747             target_os = "dragonfly",
748             target_os = "haiku",
749             target_os = "ios",
750             target_os = "macos",
751             target_os = "openbsd"
752         )))]
753         backend::termios::types::B921600 => Some(921_600),
754         #[cfg(not(any(
755             target_os = "dragonfly",
756             target_os = "freebsd",
757             target_os = "haiku",
758             target_os = "ios",
759             target_os = "macos",
760             target_os = "netbsd",
761             target_os = "openbsd",
762             target_os = "solaris",
763         )))]
764         backend::termios::types::B1000000 => Some(1_000_000),
765         #[cfg(not(any(
766             target_os = "dragonfly",
767             target_os = "freebsd",
768             target_os = "haiku",
769             target_os = "ios",
770             target_os = "macos",
771             target_os = "netbsd",
772             target_os = "openbsd",
773             target_os = "solaris",
774         )))]
775         backend::termios::types::B1152000 => Some(1_152_000),
776         #[cfg(not(any(
777             target_os = "dragonfly",
778             target_os = "freebsd",
779             target_os = "haiku",
780             target_os = "ios",
781             target_os = "macos",
782             target_os = "netbsd",
783             target_os = "openbsd",
784             target_os = "solaris",
785         )))]
786         backend::termios::types::B1500000 => Some(1_500_000),
787         #[cfg(not(any(
788             target_os = "dragonfly",
789             target_os = "freebsd",
790             target_os = "haiku",
791             target_os = "ios",
792             target_os = "macos",
793             target_os = "netbsd",
794             target_os = "openbsd",
795             target_os = "solaris",
796         )))]
797         backend::termios::types::B2000000 => Some(2_000_000),
798         #[cfg(not(any(
799             target_arch = "sparc",
800             target_arch = "sparc64",
801             target_os = "dragonfly",
802             target_os = "freebsd",
803             target_os = "haiku",
804             target_os = "ios",
805             target_os = "macos",
806             target_os = "netbsd",
807             target_os = "openbsd",
808             target_os = "solaris",
809         )))]
810         backend::termios::types::B2500000 => Some(2_500_000),
811         #[cfg(not(any(
812             target_arch = "sparc",
813             target_arch = "sparc64",
814             target_os = "dragonfly",
815             target_os = "freebsd",
816             target_os = "haiku",
817             target_os = "ios",
818             target_os = "macos",
819             target_os = "netbsd",
820             target_os = "openbsd",
821             target_os = "solaris",
822         )))]
823         backend::termios::types::B3000000 => Some(3_000_000),
824         #[cfg(not(any(
825             target_arch = "sparc",
826             target_arch = "sparc64",
827             target_os = "dragonfly",
828             target_os = "freebsd",
829             target_os = "haiku",
830             target_os = "ios",
831             target_os = "macos",
832             target_os = "netbsd",
833             target_os = "openbsd",
834             target_os = "solaris",
835         )))]
836         backend::termios::types::B3500000 => Some(3_500_000),
837         #[cfg(not(any(
838             target_arch = "sparc",
839             target_arch = "sparc64",
840             target_os = "dragonfly",
841             target_os = "freebsd",
842             target_os = "haiku",
843             target_os = "ios",
844             target_os = "macos",
845             target_os = "netbsd",
846             target_os = "openbsd",
847             target_os = "solaris",
848         )))]
849         backend::termios::types::B4000000 => Some(4_000_000),
850         _ => None,
851     }
852 }
853