@@ -30,7 +30,7 @@ impl NsecRdata{
30
30
/// Returns the next_domain_name of the `NsecRdata`.
31
31
/// # Example
32
32
/// ```
33
- /// let nsec_rdata = NsecRdata::new(String::from("www. example.com"), vec![Rtype::A, Rtype::NS]);
33
+ /// let nsec_rdata = NsecRdata::new(DomainName::new_from_str(" example.com"), vec![Rtype::A, Rtype::NS]);
34
34
/// assert_eq!(nsec_rdata.get_next_domain_name().get_name(), String::from("www.example.com"));
35
35
/// ```
36
36
pub fn get_next_domain_name ( & self ) -> DomainName {
@@ -40,10 +40,36 @@ impl NsecRdata{
40
40
/// Returns the type_bit_maps of the `NsecRdata`.
41
41
/// # Example
42
42
/// ```
43
- /// let nsec_rdata = NsecRdata::new(String::from("www. example.com"), vec![Rtype::A, Rtype::NS]);
43
+ /// let nsec_rdata = NsecRdata::new(DomainName::new_from_str(" example.com"), vec![Rtype::A, Rtype::NS]);
44
44
/// assert_eq!(nsec_rdata.get_type_bit_maps(), vec![Rtype::A, Rtype::NS]);
45
45
/// ```
46
46
pub fn get_type_bit_maps ( & self ) -> Vec < Rtype > {
47
47
self . type_bit_maps . clone ( )
48
48
}
49
+ }
50
+
51
+ impl NsecRdata {
52
+ /// Setters
53
+
54
+ /// Set the next_domain_name of the `NsecRdata`.
55
+ /// # Example
56
+ /// ```
57
+ /// let mut nsec_rdata = NsecRdata::new(DomainName::new_from_str("example.com"), vec![Rtype::A, Rtype::NS]);
58
+ /// nsec_rdata.set_next_domain_name(DomainName::new_from_str("www.example2.com"));
59
+ /// assert_eq!(nsec_rdata.get_next_domain_name().get_name(), String::from("www.example2.com"));
60
+ /// ```
61
+ pub fn set_next_domain_name ( & mut self , next_domain_name : DomainName ) {
62
+ self . next_domain_name = next_domain_name;
63
+ }
64
+
65
+ /// Set the type_bit_maps of the `NsecRdata`.
66
+ /// # Example
67
+ /// ```
68
+ /// let mut nsec_rdata = NsecRdata::new(DomainName::new_from_str("example.com"), vec![Rtype::A, Rtype::NS]);
69
+ /// nsec_rdata.set_type_bit_maps(vec![Rtype::A, Rtype::NS, Rtype::CNAME]);
70
+ /// assert_eq!(nsec_rdata.get_type_bit_maps(), vec![Rtype::A, Rtype::NS, Rtype::CNAME]);
71
+ /// ```
72
+ pub fn set_type_bit_maps ( & mut self , type_bit_maps : Vec < Rtype > ) {
73
+ self . type_bit_maps = type_bit_maps;
74
+ }
49
75
}
0 commit comments