From ef20279cfae228a8799dfcf338e5edc9ac8a8a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ing=2E=20Juan=20Jos=C3=A9=20Nicola?= Date: Mon, 14 Nov 2022 21:41:16 +0100 Subject: [PATCH] Add: function for returning NvtRef members --- rust/nvtcache/src/nvt.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rust/nvtcache/src/nvt.rs b/rust/nvtcache/src/nvt.rs index cebe44eae..582c50090 100644 --- a/rust/nvtcache/src/nvt.rs +++ b/rust/nvtcache/src/nvt.rs @@ -72,6 +72,7 @@ impl NvtPref { } impl NvtRef { + /// Return a new NvtRef object with the passed values pub fn new(ref_type: String, ref_id: String, ref_text: String) -> Result { Ok(NvtRef { ref_type, @@ -79,6 +80,18 @@ impl NvtRef { ref_text, }) } + /// Return the type of the NvtRef + pub fn get_type(&mut self) -> String { + return self.ref_type; + } + /// Return the id of the NvtRef + pub fn get_id(&mut self) -> String { + return self.ref_id; + } + /// Return the text of the NvtRef + pub fn get_text(&mut self) -> String { + return self.ref_text; + } } impl NvtSeverity {