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
use std::fmt::{Debug, Formatter};
use std::net::Ipv6Addr;
use crate::message::record::RData;

pub struct AAAARdata {
    pub rdata: Ipv6Addr
}

impl Debug for AAAARdata {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        f.debug_struct("AAAA")
            .field("IP", &self.rdata)
            .finish()
    }
}

impl RData for AAAARdata {
    fn to_bytes(&self) -> Vec<u8> {
        self.rdata.octets().to_vec()
    }
}

impl AAAARdata {
    pub fn from(rdata: Ipv6Addr) -> AAAARdata
    {
        AAAARdata {
            rdata
        }
    }
}