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
//! Error types for the index_type crate.
//!
//! This module provides the [`GenericIndexTooBigError`] type, which can be used
//! as the error type for custom index types derived with `#[derive(IndexType)]`.
use crateIndexTooBigError;
/// A generic error returned when an index exceeds the maximum representable value.
///
/// This error type can be used with `#[index_type(error = GenericIndexTooBigError)]`
/// when deriving `IndexType`:
///
/// ```
/// use index_type::{IndexType, GenericIndexTooBigError};
///
/// #[derive(IndexType, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
/// #[index_type(error = GenericIndexTooBigError)]
/// struct MyIndex(u32);
/// ```
///
/// The error displays as "index too big".
;