mod domain;
mod event;
use std::cmp::Ordering;
pub use self::{
domain::{Domain, DomainKind},
event::{Event, EventCode, EVENT_EXTRA_CAPACITY},
};
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Record {
pub(crate) cpu: u32,
pub(crate) domain: Domain,
pub(crate) event: Event,
}
impl Record {
pub fn cpu(&self) -> u32 {
self.cpu
}
pub fn domain(&self) -> &Domain {
&self.domain
}
pub fn event(&self) -> &Event {
&self.event
}
}
impl Ord for Record {
fn cmp(&self, other: &Self) -> Ordering {
self.event.cmp(&other.event)
}
}
impl PartialOrd for Record {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}