pub struct Configuration {
pub ignore: HashSet<String>,
pub max_db_age_days: Option<u64>,
}Expand description
Configuration loaded from a .gem-audit.yml file.
Fields§
§ignore: HashSet<String>Advisory IDs to ignore during scanning.
max_db_age_days: Option<u64>Maximum database age in days before warning.
Implementations§
Source§impl Configuration
impl Configuration
Sourcepub const DEFAULT_FILE: &str = ".gem-audit.yml"
pub const DEFAULT_FILE: &str = ".gem-audit.yml"
The default configuration file name.
Sourcepub const LEGACY_FILE: &str = ".bundler-audit.yml"
pub const LEGACY_FILE: &str = ".bundler-audit.yml"
Legacy configuration file name for backward compatibility.
Sourcepub fn load(path: &Path) -> Result<Self, ConfigError>
pub fn load(path: &Path) -> Result<Self, ConfigError>
Load configuration from a YAML file.
Returns an error if the file exists but contains invalid content.
Sourcepub fn load_or_default(path: &Path) -> Result<Self, ConfigError>
pub fn load_or_default(path: &Path) -> Result<Self, ConfigError>
Load configuration from a YAML file path, returning a default configuration if the file does not exist.
When the primary path does not exist and its file name matches the
default (.gem-audit.yml), the legacy name (.bundler-audit.yml)
is tried in the same directory for backward compatibility.
Sourcepub fn from_yaml(yaml: &str) -> Result<Self, ConfigError>
pub fn from_yaml(yaml: &str) -> Result<Self, ConfigError>
Parse configuration from a YAML string.
Trait Implementations§
Source§impl Clone for Configuration
impl Clone for Configuration
Source§fn clone(&self) -> Configuration
fn clone(&self) -> Configuration
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Configuration
impl Debug for Configuration
Source§impl Default for Configuration
impl Default for Configuration
Source§fn default() -> Configuration
fn default() -> Configuration
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Configuration
impl RefUnwindSafe for Configuration
impl Send for Configuration
impl Sync for Configuration
impl Unpin for Configuration
impl UnsafeUnpin for Configuration
impl UnwindSafe for Configuration
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