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
use core::{future, iter};

use crate::patterns::impl_newtype_generic;
use crate::Exhaust;

impl<T> Exhaust for future::Pending<T> {
    type Iter = iter::Once<future::Pending<T>>;
    fn exhaust() -> Self::Iter {
        iter::once(future::pending())
    }
}
impl_newtype_generic!(T: [], future::Ready<T>, future::ready);