Skip to main content

acme/api/
identifier.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
4pub struct Identifier {
5    #[serde(rename = "type")]
6    pub _type: String,
7    pub value: String,
8}
9
10impl Identifier {
11    pub(crate) fn dns(value: &str) -> Self {
12        Self {
13            _type: "dns".to_owned(),
14            value: value.to_owned(),
15        }
16    }
17
18    pub fn is_type_dns(&self) -> bool {
19        self._type == "dns"
20    }
21}