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