Debian Codegraph @

third_party/rust/rustix/src/backend/libc/net/send_recv.rs

raw
1 use crate::backend::c;
2 use bitflags::bitflags;
3
4 bitflags! {
5 /// `MSG_*` flags for use with [`send`], [`sendto`], and related
6 /// functions.
7 ///
8 /// [`send`]: crate::net::send
9 /// [`sendto`]: crate::net::sendto
10 #[repr(transparent)]
11 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
12 pub struct SendFlags: u32 {
13 /// `MSG_CONFIRM`
14 #[cfg(not(any(
15 bsd,
16 solarish,
17 windows,
18 target_os = "aix",
19 target_os = "espidf",
20 target_os = "nto",
21 target_os = "haiku",
22 target_os = "hurd",
23 target_os = "vita",
24 )))]
25 const CONFIRM = bitcast!(c::MSG_CONFIRM);
26 /// `MSG_DONTROUTE`
27 const DONTROUTE = bitcast!(c::MSG_DONTROUTE);
28 /// `MSG_DONTWAIT`
29 #[cfg(not(windows))]
30 const DONTWAIT = bitcast!(c::MSG_DONTWAIT);
31 /// Deprecated alias for [`EOR`].
32 ///
33 /// [`EOR`]: Self::EOR
34 #[cfg(not(windows))]
35 #[deprecated(note = "`rustix::net::SendFlags::EOT` is renamed to `rustix::net::SendFlags::EOR`.")]
36 const EOT = bitcast!(c::MSG_EOR);
37 /// `MSG_EOR`
38 #[cfg(not(windows))]
39 const EOR = bitcast!(c::MSG_EOR);
40 /// `MSG_MORE`
41 #[cfg(not(any(
42 bsd,
43 solarish,
44 windows,
45 target_os = "aix",
46 target_os = "haiku",
47 target_os = "hurd",
48 target_os = "nto",
49 target_os = "vita",
50 )))]
51 const MORE = bitcast!(c::MSG_MORE);
52 #[cfg(not(any(apple, windows, target_os = "vita")))]
53 /// `MSG_NOSIGNAL`
54 const NOSIGNAL = bitcast!(c::MSG_NOSIGNAL);
55 /// `MSG_OOB`
56 const OOB = bitcast!(c::MSG_OOB);
57
58 /// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
59 const _ = !0;
60 }
61 }
62
63 bitflags! {
64 /// `MSG_*` flags for use with [`recv`], [`recvfrom`], and related
65 /// functions.
66 ///
67 /// [`recv`]: crate::net::recv
68 /// [`recvfrom`]: crate::net::recvfrom
69 #[repr(transparent)]
70 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
71 pub struct RecvFlags: u32 {
72 #[cfg(not(any(
73 apple,
74 solarish,
75 windows,
76 target_os = "aix",
77 target_os = "espidf",
78 target_os = "haiku",
79 target_os = "nto",
80 target_os = "vita",
81 )))]
82 /// `MSG_CMSG_CLOEXEC`
83 const CMSG_CLOEXEC = bitcast!(c::MSG_CMSG_CLOEXEC);
84 /// `MSG_DONTWAIT`
85 #[cfg(not(windows))]
86 const DONTWAIT = bitcast!(c::MSG_DONTWAIT);
87 /// `MSG_ERRQUEUE`
88 #[cfg(not(any(
89 bsd,
90 solarish,
91 windows,
92 target_os = "aix",
93 target_os = "espidf",
94 target_os = "haiku",
95 target_os = "hurd",
96 target_os = "nto",
97 target_os = "vita",
98 )))]
99 const ERRQUEUE = bitcast!(c::MSG_ERRQUEUE);
100 /// `MSG_OOB`
101 const OOB = bitcast!(c::MSG_OOB);
102 /// `MSG_PEEK`
103 const PEEK = bitcast!(c::MSG_PEEK);
104 /// `MSG_TRUNC`
105 const TRUNC = bitcast!(c::MSG_TRUNC);
106 /// `MSG_WAITALL`
107 const WAITALL = bitcast!(c::MSG_WAITALL);
108
109 /// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
110 const _ = !0;
111 }
112 }