1use std::fmt::Display;
2
3#[derive(Debug, Clone, Hash, Eq, PartialEq, PartialOrd)]
8pub struct Certificate(pub(crate) String);
9
10impl Certificate {
11 pub fn new<S: Into<String>>(id: S) -> Self {
12 Self(id.into())
13 }
14}
15
16impl Display for Certificate {
17 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18 write!(f, "{}", self.0)
19 }
20}
21
22impl<S: Into<String>> From<S> for Certificate {
25 fn from(value: S) -> Self {
26 Certificate::new(value)
27 }
28}
29
30#[derive(Debug, Clone, Eq, PartialEq, Hash)]
32pub struct Identity(pub(crate) String);
33
34impl Identity {
35 pub fn new<S: Into<String>>(id: S) -> Self {
36 Self(id.into())
37 }
38}
39
40impl Display for Identity {
41 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
42 write!(f, "{}", self.0)
43 }
44}
45
46impl<S: Into<String>> From<S> for Identity {
49 fn from(value: S) -> Self {
50 Identity::new(value)
51 }
52}