]> git.proxmox.com Git - rustc.git/blob - vendor/rustix-0.37.6/src/net/mod.rs
New upstream version 1.74.1+dfsg1
[rustc.git] / vendor / rustix-0.37.6 / src / net / mod.rs
1 //! Network-related operations.
2 //!
3 //! On Windows, one must call [`wsa_startup`] in the process before calling any
4 //! of these APIs. [`wsa_cleanup`] may be used in the process if these APIs are
5 //! no longer needed.
6 //!
7 //! [`wsa_startup`]: https://docs.rs/rustix/*/x86_64-pc-windows-msvc/rustix/net/fn.wsa_startup.html
8 //! [`wsa_cleanup`]: https://docs.rs/rustix/*/x86_64-pc-windows-msvc/rustix/net/fn.wsa_cleanup.html
9
10 #[cfg(not(feature = "std"))]
11 mod addr;
12 #[cfg(not(feature = "std"))]
13 mod ip;
14 mod send_recv;
15 mod socket;
16 mod socket_addr_any;
17 #[cfg(not(any(windows, target_os = "wasi")))]
18 mod socketpair;
19 #[cfg(windows)]
20 mod wsa;
21
22 pub mod sockopt;
23
24 pub use send_recv::*;
25 pub use socket::*;
26 pub use socket_addr_any::{SocketAddrAny, SocketAddrStorage};
27 #[cfg(not(any(windows, target_os = "wasi")))]
28 pub use socketpair::socketpair;
29 #[cfg(feature = "std")]
30 pub use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
31 #[cfg(windows)]
32 pub use wsa::{wsa_cleanup, wsa_startup};
33 #[cfg(not(feature = "std"))]
34 pub use {
35 addr::{SocketAddr, SocketAddrV4, SocketAddrV6},
36 ip::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope},
37 };
38 #[cfg(unix)]
39 pub use {
40 send_recv::sendto_unix,
41 socket::{bind_unix, connect_unix, SocketAddrUnix},
42 };