Debian Codegraph @

third_party/rust/socket2/README.md

raw
1 # Socket2
2
3 Socket2 is a crate that provides utilities for creating and using sockets.
4
5 The goal of this crate is to create and use a socket using advanced
6 configuration options (those that are not available in the types in the standard
7 library) without using any unsafe code.
8
9 This crate provides as direct as possible access to the system's functionality
10 for sockets, this means little effort to provide cross-platform utilities. It is
11 up to the user to know how to use sockets when using this crate. *If you don't
12 know how to create a socket using libc/system calls then this crate is not for
13 you*. Most, if not all, functions directly relate to the equivalent system call
14 with no error handling applied, so no handling errors such as `EINTR`. As a
15 result using this crate can be a little wordy, but it should give you maximal
16 flexibility over configuration of sockets.
17
18 See the [API documentation] for more.
19
20 [API documentation]: https://docs.rs/socket2
21
22 # Branches
23
24 Currently Socket2 supports two versions: v0.5 and v0.4. Version 0.5 is being
25 developed in the master branch. Version 0.4 is developed in the [v0.4.x branch]
26 branch.
27
28 [v0.4.x branch]: https://github.com/rust-lang/socket2/tree/v0.4.x
29
30 # OS support
31
32 Socket2 attempts to support the same OS/architectures as Rust does, see
33 https://doc.rust-lang.org/nightly/rustc/platform-support.html. However this is
34 not always possible, below is current list of support OSs.
35
36 *If your favorite OS is not on the list consider contributing it! See [issue
37 #78].*
38
39 [issue #78]: https://github.com/rust-lang/socket2/issues/78
40
41 ### Tier 1
42
43 These OSs are tested with each commit in the CI and must always pass the tests.
44 All functions/types/etc., excluding ones behind the `all` feature, must work on
45 these OSs.
46
47 * Linux
48 * macOS
49 * Windows
50
51 ### Tier 2
52
53 These OSs are currently build in the CI, but not tested. Not all
54 functions/types/etc. may work on these OSs, even ones **not** behind the `all`
55 feature flag.
56
57 * Android
58 * FreeBSD
59 * Fuchsia
60 * iOS
61 * illumos
62 * NetBSD
63 * Redox
64 * Solaris
65
66 # Minimum Supported Rust Version (MSRV)
67
68 Socket2 uses 1.63.0 as MSRV.
69
70 # License
71
72 This project is licensed under either of
73
74 * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
75 https://www.apache.org/licenses/LICENSE-2.0)
76 * MIT license ([LICENSE-MIT](LICENSE-MIT) or
77 https://opensource.org/licenses/MIT)
78
79 at your option.
80
81 ### Contribution
82
83 Unless you explicitly state otherwise, any contribution intentionally submitted
84 for inclusion in this project by you, as defined in the Apache-2.0 license,
85 shall be dual licensed as above, without any additional terms or conditions.