1use std::fmt;
2
3use uuid::Uuid;
4
5#[derive(Clone, Copy, PartialEq, Eq, Hash)]
9pub struct TaskId(Uuid);
10
11impl TaskId {
12 pub(crate) fn new_v4() -> Self {
14 Self(Uuid::new_v4())
15 }
16}
17
18impl fmt::Debug for TaskId {
19 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
20 fmt::Debug::fmt(&self.0, f)
21 }
22}
23
24impl fmt::Display for TaskId {
25 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
26 fmt::Display::fmt(&self.0, f)
27 }
28}
29
30#[derive(Clone, Copy, PartialEq, Eq, Hash)]
35pub struct GlobalProgressListenerId(Uuid);
36
37impl GlobalProgressListenerId {
38 pub(crate) fn new_v4() -> Self {
40 Self(Uuid::new_v4())
41 }
42}
43
44impl fmt::Debug for GlobalProgressListenerId {
45 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
46 fmt::Debug::fmt(&self.0, f)
47 }
48}