Skip to main content

des_sim/primitive/id/
event_id.rs

1//! The `event_id` module defines the `EventId` type, a unique identifier
2//! for each event within the simulation.
3//!
4//! This ID is crucial for tracking, referencing, and managing individual
5//! events throughout their lifecycle.
6
7/// Represents a unique identifier for an event within the simulation.
8#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
9pub struct EventId(u64);
10
11impl EventId {
12    /// Creates a new `EventId` with the specified value.
13    pub(crate) fn new(value: u64) -> Self {
14        EventId(value)
15    }
16
17    /// Returns the raw numerical value of the identifier.
18    pub fn value(&self) -> u64 {
19        self.0
20    }
21}