dns_message_parser/rr/
rfc_1712.rs

1use super::Class;
2use crate::DomainName;
3use std::fmt::{Display, Formatter, Result as FmtResult};
4
5/// The [geographical location] resource record type.
6///
7/// [geographical location]: https://tools.ietf.org/html/rfc1712#section-4
8#[derive(Debug, Clone, PartialEq, Eq, Hash)]
9pub struct GPOS {
10    pub domain_name: DomainName,
11    pub ttl: u32,
12    pub class: Class,
13    pub longitude: String,
14    pub latitude: String,
15    pub altitude: String,
16}
17
18impl_to_type!(GPOS);
19
20impl Display for GPOS {
21    fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
22        write!(
23            f,
24            "{} {} {} GPOS {} {} {}",
25            self.domain_name, self.ttl, self.class, self.longitude, self.latitude, self.altitude,
26        )
27    }
28}