ps-promise 0.1.0-17

Promise-like owned futures
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::cmp::Ordering;

use crate::WrappedPromiseRejection;

impl<E> PartialOrd for WrappedPromiseRejection<E>
where
    E: PartialOrd + Send + 'static,
{
    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
        match (self, other) {
            (Self::AlreadyConsumed, Self::AlreadyConsumed) => Some(Ordering::Equal),
            (Self::Rejected(a), Self::Rejected(b)) => a.partial_cmp(b),
            _ => None,
        }
    }
}