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
/// A trait for types that have a maximum value.
///
/// This trait must be implemented for `T` in [`OrdMask<T>`](crate::OrdMask)
/// if [`.spans()`](crate::OrdMask::spans)
/// or [`.into_spans()`](crate::OrdMask::into_spans) is used.
///
/// The library provides implementations for all standard integer types:
/// `u8`, `u16`, `u32`, `u64`, `u128`, `usize`, `i8`, `i16`, `i32`, `i64`, `i128`, `isize`.
///
/// # Example
///
/// ```
/// use ordmask::{WithMax, WithMin, ordmask};
///
/// #[derive(Clone, Ord, PartialOrd, Eq, PartialEq, Debug)]
/// struct MyType(i32);
///
/// impl WithMin for MyType {
/// const MIN: Self = MyType(i32::MIN);
/// }
///
/// impl WithMax for MyType {
/// const MAX: Self = MyType(i32::MAX);
/// }
///
/// assert_eq!(
/// ordmask![..].spans().collect::<Vec<_>>(),
/// vec![(MyType(i32::MIN), MyType(i32::MAX))],
/// );
///
/// ```
impl_for!
impl_for!