pub trait RuleConfiguration {
// Required methods
fn configure(
&mut self,
properties: RuleProperties,
) -> Result<(), RuleConfigurationError>;
fn get_name(&self) -> &'static str;
fn serialize_to_properties(&self) -> RuleProperties;
// Provided method
fn has_properties(&self) -> bool { ... }
}
Expand description
Defines the configuration interface for rules.
This trait provides methods for configuring rules through properties and serializing their configuration state.
Required Methods§
Sourcefn configure(
&mut self,
properties: RuleProperties,
) -> Result<(), RuleConfigurationError>
fn configure( &mut self, properties: RuleProperties, ) -> Result<(), RuleConfigurationError>
Configures the rule with the given properties.
Returns an error if the configuration is invalid.
Sourcefn serialize_to_properties(&self) -> RuleProperties
fn serialize_to_properties(&self) -> RuleProperties
Serializes the rule’s configuration to properties.
Only properties that differ from their default values are included.
Provided Methods§
Sourcefn has_properties(&self) -> bool
fn has_properties(&self) -> bool
Returns whether the rule has any non-default properties.