pub struct GuardianConfig {
pub version: String,
pub paths: PathConfig,
pub patterns: HashMap<String, PatternCategory>,
}Expand description
Main configuration structure for Rust Guardian
Fields§
§version: StringConfiguration format version
paths: PathConfigPath filtering configuration
patterns: HashMap<String, PatternCategory>Pattern definitions organized by category
Implementations§
Source§impl GuardianConfig
impl GuardianConfig
Sourcepub fn load_from_file<P: AsRef<Path>>(path: P) -> GuardianResult<Self>
pub fn load_from_file<P: AsRef<Path>>(path: P) -> GuardianResult<Self>
Load configuration from a YAML file
Sourcepub fn load_from_str(content: &str) -> GuardianResult<Self>
pub fn load_from_str(content: &str) -> GuardianResult<Self>
Load configuration from string content
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Get default configuration with built-in patterns
Sourcepub fn validate(&self) -> GuardianResult<()>
pub fn validate(&self) -> GuardianResult<()>
Validate the configuration for consistency and correctness
Sourcepub fn enabled_rules(
&self,
) -> impl Iterator<Item = (&String, &PatternCategory, &PatternRule)>
pub fn enabled_rules( &self, ) -> impl Iterator<Item = (&String, &PatternCategory, &PatternRule)>
Get all enabled rules across all categories
Sourcepub fn effective_severity(
&self,
category: &PatternCategory,
rule: &PatternRule,
) -> Severity
pub fn effective_severity( &self, category: &PatternCategory, rule: &PatternRule, ) -> Severity
Get effective severity for a rule (rule override or category default)
Sourcepub fn to_json(&self) -> GuardianResult<String>
pub fn to_json(&self) -> GuardianResult<String>
Convert to JSON for serialization
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
Create a fingerprint of the configuration for cache validation
Source§impl GuardianConfig
impl GuardianConfig
Sourcepub fn verify_config_integrity(&self) -> GuardianResult<()>
pub fn verify_config_integrity(&self) -> GuardianResult<()>
Self-validating configuration integrity check following architectural principles Guardian validates itself rather than relying on external tests
Sourcepub fn verify_evolution_capability() -> GuardianResult<()>
pub fn verify_evolution_capability() -> GuardianResult<()>
Verify configuration can evolve correctly (builder pattern validation)
Sourcepub fn verify_serialization_fidelity(&self) -> GuardianResult<()>
pub fn verify_serialization_fidelity(&self) -> GuardianResult<()>
Verify serialization maintains configuration integrity
Trait Implementations§
Source§impl Clone for GuardianConfig
impl Clone for GuardianConfig
Source§fn clone(&self) -> GuardianConfig
fn clone(&self) -> GuardianConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GuardianConfig
impl Debug for GuardianConfig
Source§impl Default for GuardianConfig
impl Default for GuardianConfig
Source§impl<'de> Deserialize<'de> for GuardianConfig
impl<'de> Deserialize<'de> for GuardianConfig
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>,
Auto Trait Implementations§
impl Freeze for GuardianConfig
impl RefUnwindSafe for GuardianConfig
impl Send for GuardianConfig
impl Sync for GuardianConfig
impl Unpin for GuardianConfig
impl UnsafeUnpin for GuardianConfig
impl UnwindSafe for GuardianConfig
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
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> 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>
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>
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