pub struct AdvisoryDatabase { /* private fields */ }Expand description
Advisory database for caching and querying security advisories
Implementations§
Source§impl AdvisoryDatabase
impl AdvisoryDatabase
Sourcepub fn load_from_cache() -> Result<Self, String>
pub fn load_from_cache() -> Result<Self, String>
Load database from cache
Sourcepub fn save_to_cache(&self) -> Result<(), String>
pub fn save_to_cache(&self) -> Result<(), String>
Save database to cache
Sourcepub fn add_advisory(&mut self, advisory: Advisory)
pub fn add_advisory(&mut self, advisory: Advisory)
Add an advisory to the database
Sourcepub fn get_advisory(&self, id: &str) -> Option<&Advisory>
pub fn get_advisory(&self, id: &str) -> Option<&Advisory>
Get an advisory by ID
Sourcepub fn by_severity(&self, severity: Severity) -> Vec<&Advisory>
pub fn by_severity(&self, severity: Severity) -> Vec<&Advisory>
Get advisories by severity
Sourcepub fn get_all_cve_ids(&self) -> Vec<&str>
pub fn get_all_cve_ids(&self) -> Vec<&str>
Get all CVE IDs
Trait Implementations§
Source§impl Debug for AdvisoryDatabase
impl Debug for AdvisoryDatabase
Source§impl Default for AdvisoryDatabase
impl Default for AdvisoryDatabase
Source§fn default() -> AdvisoryDatabase
fn default() -> AdvisoryDatabase
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AdvisoryDatabase
impl<'de> Deserialize<'de> for AdvisoryDatabase
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AdvisoryDatabase
impl RefUnwindSafe for AdvisoryDatabase
impl Send for AdvisoryDatabase
impl Sync for AdvisoryDatabase
impl Unpin for AdvisoryDatabase
impl UnsafeUnpin for AdvisoryDatabase
impl UnwindSafe for AdvisoryDatabase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more