]>
git.proxmox.com Git - rustc.git/blob - vendor/hashbrown/src/lib.rs
1 //! This crate is a Rust port of Google's high-performance [SwissTable] hash
2 //! map, adapted to make it a drop-in replacement for Rust's standard `HashMap`
3 //! and `HashSet` types.
5 //! The original C++ version of [SwissTable] can be found [here], and this
6 //! [CppCon talk] gives an overview of how the algorithm works.
8 //! [SwissTable]: https://abseil.io/blog/20180927-swisstables
9 //! [here]: https://github.com/abseil/abseil-cpp/blob/master/absl/container/internal/raw_hash_set.h
10 //! [CppCon talk]: https://www.youtube.com/watch?v=ncHmEUmJZf4
15 feature(test
, core_intrinsics
, dropck_eyepatch
, min_specialization
, extend_one
)
19 clippy
::module_name_repetitions
,
20 clippy
::must_use_candidate
,
21 clippy
::option_if_let_else
23 #![warn(missing_docs)]
24 #![warn(rust_2018_idioms)]
30 #[cfg_attr(test, macro_use)]
33 #[cfg(feature = "nightly")]
35 doc_comment
::doctest
!("../README.md");
40 #[cfg(feature = "raw")]
41 /// Experimental and unsafe `RawTable` API. This module is only available if the
42 /// `raw` feature is enabled.
44 // The RawTable API is still experimental and is not properly documented yet.
45 #[allow(missing_docs)]
50 #[cfg(feature = "rayon")]
52 pub use crate::external_trait_impls
::rayon
::raw
::*;
55 #[cfg(not(feature = "raw"))]
58 mod external_trait_impls
;
60 #[cfg(feature = "rustc-internal-api")]
66 //! A hash map implemented with quadratic probing and SIMD lookup.
67 pub use crate::map
::*;
69 #[cfg(feature = "rustc-internal-api")]
70 pub use crate::rustc_entry
::*;
72 #[cfg(feature = "rayon")]
73 /// [rayon]-based parallel iterator types for hash maps.
74 /// You will rarely need to interact with it directly unless you have need
75 /// to name one of the iterator types.
77 /// [rayon]: https://docs.rs/rayon/1.0/rayon
79 pub use crate::external_trait_impls
::rayon
::map
::*;
83 //! A hash set implemented as a `HashMap` where the value is `()`.
84 pub use crate::set
::*;
86 #[cfg(feature = "rayon")]
87 /// [rayon]-based parallel iterator types for hash sets.
88 /// You will rarely need to interact with it directly unless you have need
89 /// to name one of the iterator types.
91 /// [rayon]: https://docs.rs/rayon/1.0/rayon
93 pub use crate::external_trait_impls
::rayon
::set
::*;
97 pub use crate::map
::HashMap
;
98 pub use crate::set
::HashSet
;
100 /// The error type for `try_reserve` methods.
101 #[derive(Clone, PartialEq, Eq, Debug)]
102 pub enum TryReserveError
{
103 /// Error due to the computed capacity exceeding the collection's maximum
104 /// (usually `isize::MAX` bytes).
107 /// The memory allocator returned an error
109 /// The layout of the allocation request that failed.
110 layout
: alloc
::alloc
::Layout
,