• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 mod send_recv;
11 mod socket;
12 mod socket_addr_any;
13 #[cfg(not(any(windows, target_os = "wasi")))]
14 mod socketpair;
15 mod types;
16 #[cfg(windows)]
17 mod wsa;
18 
19 #[cfg(linux_kernel)]
20 pub mod netdevice;
21 pub mod sockopt;
22 
23 pub use crate::maybe_polyfill::net::{
24     IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6,
25 };
26 pub use send_recv::*;
27 pub use socket::*;
28 pub use socket_addr_any::{SocketAddrAny, SocketAddrStorage};
29 #[cfg(not(any(windows, target_os = "wasi")))]
30 pub use socketpair::socketpair;
31 pub use types::*;
32 #[cfg(windows)]
33 pub use wsa::{wsa_cleanup, wsa_startup};
34