exhaust 0.2.6

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
use core::task;

use crate::patterns::delegate_factory_and_iter;
use crate::Exhaust;

impl<T: Exhaust> Exhaust for task::Poll<T> {
    delegate_factory_and_iter!(Option<T>);

    fn from_factory(factory: Self::Factory) -> Self {
        match Option::<T>::from_factory(factory) {
            None => task::Poll::Pending,
            Some(val) => task::Poll::Ready(val),
        }
    }
}