1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use std::borrow::Cow;
use std::fmt;
use response::NamedResponse;
use response;
#[derive(Deserialize)]
pub struct DnsRecord {
pub id: f64,
#[serde(rename="type")]
pub rec_type: String,
pub name: String,
pub data: String,
pub priority: Option<f64>,
pub port: Option<f64>,
pub weight: Option<f64>,
}
impl response::NotArray for DnsRecord {}
pub type DnsRecords = Vec<DnsRecord>;
impl NamedResponse for DnsRecord {
fn name<'a>() -> Cow<'a, str> {
"domain_record".into()
}
}
impl fmt::Display for DnsRecord {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", "dns_record")
}
}