update: 增加一些 CUSA 结构体方法

Signed-off-by: Jia Chao <jiachao2130@126.com>
This commit is contained in:
Jia Chao 2024-08-05 17:12:02 +08:00
parent d92d0c2c49
commit 5c3eb4656f
2 changed files with 32 additions and 3 deletions

View File

@ -23,6 +23,38 @@ pub struct CUSA {
pub cves: Vec<CVE>,
}
impl CUSA {
/// sa id
pub fn id(&self) -> &str {
&self.id
}
/// sa info url
pub fn url(&self) -> &str {
&self.url
}
/// title
pub fn title(&self) -> &str {
&self.title
}
/// severity lvl
pub fn severity(&self) -> &Severity {
&self.severity
}
/// 详尽的描述信息
pub fn description(&self) -> &str {
&self.description
}
/// 包含的 cve 列表
pub fn cves(&self) -> &Vec<CVE> {
&self.cves
}
}
#[derive(Debug, Clone, PartialOrd, Ord, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Severity {
None,

View File

@ -1,3 +0,0 @@
fn main() {
println!("Hello, world!");
}