Skip to content

Commit

Permalink
add getters and setters
Browse files Browse the repository at this point in the history
  • Loading branch information
Litr0 committed Jul 17, 2024
1 parent 94ecc48 commit e39a96a
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/message/rdata/srv_rdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,48 @@ impl SrvRdata {
target,
}
}
}

impl SrvRdata {
/// Gets the priority atrribute of the SrvRdata.
pub fn get_priority(&self) -> u16 {
self.priority
}

/// Gets the weight atrribute of the SrvRdata.
pub fn get_weight(&self) -> u16 {
self.weight
}

/// Gets the port atrribute of the SrvRdata.
pub fn get_port(&self) -> u16 {
self.port
}

/// Gets the target atrribute of the SrvRdata.
pub fn get_target(&self) -> DomainName {
self.target.clone()
}
}

impl SrvRdata {
/// Sets the priority atrribute of the SrvRdata.
pub fn set_priority(&mut self, priority: u16) {
self.priority = priority;
}

/// Sets the weight atrribute of the SrvRdata.
pub fn set_weight(&mut self, weight: u16) {
self.weight = weight;
}

/// Sets the port atrribute of the SrvRdata.
pub fn set_port(&mut self, port: u16) {
self.port = port;
}

/// Sets the target atrribute of the SrvRdata.
pub fn set_target(&mut self, target: DomainName) {
self.target = target;
}
}

0 comments on commit e39a96a

Please sign in to comment.