exhaust 0.2.1

Trait and derive macro for working with all possible values of a type (exhaustive enumeration).
Documentation
use core::task;

use crate::Exhaust;

impl<T: Exhaust> Exhaust for task::Poll<T> {
    type Iter = <Option<T> as Exhaust>::Iter;
    type Factory = <Option<T> as Exhaust>::Factory;

    fn exhaust_factories() -> Self::Iter {
        Option::<T>::exhaust_factories()
    }

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