rustix/backend/linux_raw/net/
send_recv.rs

1use crate::backend::c;
2use bitflags::bitflags;
3
4bitflags! {
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        const CONFIRM = c::MSG_CONFIRM;
15        /// `MSG_DONTROUTE`
16        const DONTROUTE = c::MSG_DONTROUTE;
17        /// `MSG_DONTWAIT`
18        const DONTWAIT = c::MSG_DONTWAIT;
19        /// Deprecated alias for [`EOR`].
20        ///
21        /// [`EOR`]: Self::EOR
22        #[deprecated(note = "`rustix::net::SendFlags::EOT` is renamed to `rustix::net::SendFlags::EOR`.")]
23        const EOT = c::MSG_EOR;
24        /// `MSG_EOR`
25        const EOR = c::MSG_EOR;
26        /// `MSG_MORE`
27        const MORE = c::MSG_MORE;
28        /// `MSG_NOSIGNAL`
29        const NOSIGNAL = c::MSG_NOSIGNAL;
30        /// `MSG_OOB`
31        const OOB = c::MSG_OOB;
32
33        /// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
34        const _ = !0;
35    }
36}
37
38bitflags! {
39    /// `MSG_*` flags for use with [`recv`], [`recvfrom`], and related
40    /// functions.
41    ///
42    /// [`recv`]: crate::net::recv
43    /// [`recvfrom`]: crate::net::recvfrom
44    #[repr(transparent)]
45    #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
46    pub struct RecvFlags: u32 {
47        /// `MSG_CMSG_CLOEXEC`
48        const CMSG_CLOEXEC = c::MSG_CMSG_CLOEXEC;
49        /// `MSG_DONTWAIT`
50        const DONTWAIT = c::MSG_DONTWAIT;
51        /// `MSG_ERRQUEUE`
52        const ERRQUEUE = c::MSG_ERRQUEUE;
53        /// `MSG_OOB`
54        const OOB = c::MSG_OOB;
55        /// `MSG_PEEK`
56        const PEEK = c::MSG_PEEK;
57        /// `MSG_TRUNC`
58        const TRUNC = c::MSG_TRUNC;
59        /// `MSG_WAITALL`
60        const WAITALL = c::MSG_WAITALL;
61
62        /// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
63        const _ = !0;
64    }
65}