use re_chunk_store::RowId;
use re_log_types::TimeInt;
#[derive(Clone, Copy, Debug)]
pub struct TimeKey {
pub time: TimeInt,
pub row_id: RowId,
}
impl From<(TimeInt, RowId)> for TimeKey {
#[inline]
fn from((time, row_id): (TimeInt, RowId)) -> Self {
Self { time, row_id }
}
}
impl PartialEq for TimeKey {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.time == other.time
}
}
impl Eq for TimeKey {}
impl PartialOrd for TimeKey {
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.time.cmp(&other.time))
}
}
impl Ord for TimeKey {
#[inline]
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.time.cmp(&other.time)
}
}