You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However you may still want to use this crate instead since it works in
19
19
environments without `std`, such as embedded systems and kernels.
20
20
@@ -27,11 +27,14 @@ environments without `std`, such as embedded systems and kernels.
27
27
## Features
28
28
29
29
- Drop-in replacement for the standard library `HashMap` and `HashSet` types.
30
-
- Uses [foldhash](https://github.com/orlp/foldhash) as the default hasher, which is much faster than SipHash.
31
-
However, foldhash does *not provide the same level of HashDoS resistance* as SipHash, so if that is important to you, you might want to consider using a different hasher.
30
+
- Uses [foldhash](https://github.com/orlp/foldhash) as the default hasher, which
31
+
is much faster than SipHash. However, foldhash does *not provide the same
32
+
level of HashDoS resistance* as SipHash, so if that is important to you, you
33
+
might want to consider using a different hasher.
32
34
- Around 2x faster than the previous standard library `HashMap`.
33
35
- Lower memory usage: only 1 byte of overhead per entry instead of 8.
34
-
- Compatible with `#[no_std]` (but requires a global allocator with the `alloc` crate).
36
+
- Compatible with `#[no_std]` (but requires a global allocator with the `alloc`
37
+
crate).
35
38
- Empty hash maps do not allocate any memory.
36
39
- SIMD lookups to scan multiple hash entries in parallel.
37
40
@@ -41,7 +44,7 @@ Add this to your `Cargo.toml`:
41
44
42
45
```toml
43
46
[dependencies]
44
-
hashbrown = "0.16"
47
+
hashbrown = "0.17"
45
48
```
46
49
47
50
Then:
@@ -54,29 +57,35 @@ map.insert(1, "one");
54
57
```
55
58
56
59
## Flags
60
+
57
61
This crate has the following Cargo features:
58
62
59
63
-`nightly`: Enables nightly-only features including: `#[may_dangle]`.
60
64
-`serde`: Enables serde serialization support.
61
65
-`rayon`: Enables rayon parallel iterator support.
62
-
-`equivalent`: Allows comparisons to be customized with the `Equivalent` trait. (enabled by default)
66
+
-`equivalent`: Allows comparisons to be customized with the `Equivalent` trait.
67
+
(enabled by default)
63
68
-`raw-entry`: Enables access to the deprecated `RawEntry` API.
64
-
-`inline-more`: Adds inline hints to most functions, improving run-time performance at the cost
65
-
of compilation time. (enabled by default)
66
-
-`default-hasher`: Compiles with foldhash as default hasher. (enabled by default)
67
-
-`allocator-api2`: Enables support for allocators that support `allocator-api2`. (enabled by default)
69
+
-`inline-more`: Adds inline hints to most functions, improving run-time
70
+
performance at the cost of compilation time. (enabled by default)
71
+
-`default-hasher`: Compiles with foldhash as default hasher. (enabled by
72
+
default)
73
+
-`allocator-api2`: Enables support for allocators that support
74
+
`allocator-api2`. (enabled by default)
68
75
69
76
## License
70
77
71
78
Licensed under either of:
72
79
73
-
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)
74
-
* MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)
80
+
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
81
+
https://www.apache.org/licenses/LICENSE-2.0)
82
+
* MIT license ([LICENSE-MIT](LICENSE-MIT) or
83
+
https://opensource.org/license/mit)
75
84
76
85
at your option.
77
86
78
87
### Contribution
79
88
80
89
Unless you explicitly state otherwise, any contribution intentionally submitted
81
-
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
82
-
additional terms or conditions.
90
+
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
91
+
dual licensed as above, without any additional terms or conditions.
0 commit comments