use std::cmp::Ordering;
use std::sync::Arc;
use std::time::Instant;
use super::{Node, ScheduledTimer};
pub(crate) struct HeapTimer {
pub(crate) at: Instant,
pub(crate) gen: usize,
pub(crate) node: Arc<Node<ScheduledTimer>>,
}
impl PartialEq for HeapTimer {
fn eq(&self, other: &HeapTimer) -> bool {
self.at == other.at
}
}
impl Eq for HeapTimer {}
impl PartialOrd for HeapTimer {
fn partial_cmp(&self, other: &HeapTimer) -> Option<Ordering> {
Some(self.cmp(other))
}
}
impl Ord for HeapTimer {
fn cmp(&self, other: &HeapTimer) -> Ordering {
self.at.cmp(&other.at)
}
}