neptune_job_queue/job_id.rs
1/// A unique identifier for a [Job](super::traits::Job)
2#[derive(Debug, Clone, Copy)]
3pub struct JobId([u8; 12]);
4
5impl std::fmt::Display for JobId {
6 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7 for byte in &self.0 {
8 write!(f, "{:02x}", byte)?;
9 }
10 Ok(())
11 }
12}
13
14impl JobId {
15 /// generates a random JobId
16 pub(super) fn random() -> Self {
17 Self(rand::random())
18 }
19}