pub struct AuditorConfig {
pub disabled_rules: HashSet<String>,
pub enabled_categories: Option<HashSet<String>>,
pub severity_overrides: HashMap<String, String>,
pub min_severity: Option<Severity>,
}Expand description
Cấu hình kiểm toán ngôn ngữ học (Auditor Configuration).
Fields§
§disabled_rules: HashSet<String>Danh sách các mã luật bị vô hiệu hóa (disabled).
enabled_categories: Option<HashSet<String>>Nhóm thể loại được kích hoạt (nếu None thì cho phép toàn bộ).
severity_overrides: HashMap<String, String>Ghi đè mức độ nghiêm trọng (pattern_id -> new severity, e.g. “warning”, “critical”, “minor”, “suggestion”).
min_severity: Option<Severity>Ngưỡng mức độ nghiêm trọng tối thiểu (nếu Some, bỏ qua các finding dưới ngưỡng này).
Implementations§
Source§impl AuditorConfig
impl AuditorConfig
pub fn new() -> Self
pub fn disable_rule(&mut self, rule_id: impl Into<String>) -> &mut Self
pub fn enable_rule(&mut self, rule_id: &str) -> &mut Self
pub fn set_enabled_categories(&mut self, categories: Vec<String>) -> &mut Self
pub fn override_severity( &mut self, rule_id: impl Into<String>, severity: impl Into<String>, ) -> &mut Self
pub fn set_min_severity(&mut self, min: Severity) -> &mut Self
pub fn is_rule_enabled(&self, rule_id: &str, category: &str) -> bool
Trait Implementations§
Source§impl Clone for AuditorConfig
impl Clone for AuditorConfig
Source§impl Debug for AuditorConfig
impl Debug for AuditorConfig
Source§impl Default for AuditorConfig
impl Default for AuditorConfig
Source§impl<'de> Deserialize<'de> for AuditorConfig
impl<'de> Deserialize<'de> for AuditorConfig
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 Forget for AuditorConfig
impl Freeze for AuditorConfig
impl RefUnwindSafe for AuditorConfig
impl Send for AuditorConfig
impl Sync for AuditorConfig
impl Unpin for AuditorConfig
impl UnsafeUnpin for AuditorConfig
impl UnwindSafe for AuditorConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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