1use crate::header::Header;
2use crate::question::Question;
3use crate::resource_record::ResourceRecord;
4
5pub type Answer<'a> = ResourceRecord<'a>;
6pub type Authority<'a> = ResourceRecord<'a>;
7pub type Additional<'a> = ResourceRecord<'a>;
8
9#[derive(Debug, Clone, PartialEq, Eq)]
10pub struct Message<'a> {
11 pub header: Header,
12 pub question: Vec<Question<'a>>,
13 pub answer: Vec<Answer<'a>>,
14 pub authority: Vec<Authority<'a>>,
15 pub additional: Vec<Additional<'a>>,
16}
17
18impl<'a> Message<'a> {
19 pub fn new(
20 header: Header,
21 question: Vec<Question<'a>>,
22 answer: Vec<Answer<'a>>,
23 authority: Vec<Authority<'a>>,
24 additional: Vec<Additional<'a>>,
25 ) -> Self {
26 Self {
27 header,
28 question,
29 answer,
30 authority,
31 additional,
32 }
33 }
34}