1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// For cargo-rdme.
//! The library provides [`Ordinal`](crate::Ordinal) trait to map types to `usize` values,
//! proc-macro to derive `Ordinal` trait for structs and enums,
//! and [`map`](crate::map) and [`set`](crate::set) implementations
//! that use these types as keys efficiently.
//!
//! # Example
//!
//! ```
//! use ordinal_map::map::total::OrdinalTotalMap;
//! #[derive(ordinal_map::Ordinal)]
//! enum ErrorCategory {
//! Network,
//! Disk,
//! Logic,
//! }
//!
//! fn classify_error(error: &str) -> ErrorCategory {
//! // ...
//! # ErrorCategory::Network
//! }
//!
//! let mut error_counts: OrdinalTotalMap<ErrorCategory, u64> = OrdinalTotalMap::default();
//!
//! # let errors = [""; 0];
//! for error in &errors {
//! let category = classify_error(error);
//! error_counts[&category] += 1;
//! }
//! ```
extern crate quickcheck_macros;
pub
pub
pub
pub use AtomicOrdinal;
pub use Ordinal;
pub use Ordinal;
pub use OrdinalValues;
pub