exhaust 0.1.2

Trait and derive macro for working with all possible values of a type (exhaustive enumeration).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use core::iter;

use crate::Exhaust;

impl<T: ?Sized> Exhaust for core::marker::PhantomData<T> {
    type Iter = iter::Once<core::marker::PhantomData<T>>;
    fn exhaust() -> Self::Iter {
        iter::once(core::marker::PhantomData)
    }
}

impl Exhaust for core::marker::PhantomPinned {
    type Iter = iter::Once<core::marker::PhantomPinned>;
    fn exhaust() -> Self::Iter {
        iter::once(core::marker::PhantomPinned)
    }
}