RuleConfiguration

public protocol RuleConfiguration : Equatable

A configuration value for a rule to allow users to modify its behavior.

  • The type of the rule that’s using this configuration.

    Declaration

    Swift

    associatedtype Parent : Rule
  • parameterDescription Default implementation

    A description for this configuration’s parameters. It can be built using the annotated result builder.

    Default Implementation

    Declaration

    Swift

    @RuleConfigurationDescriptionBuilder
    var parameterDescription: RuleConfigurationDescription? { get }
  • Apply an untyped configuration to the current value.

    Throws

    Throws if the configuration is not in the expected format.

    Declaration

    Swift

    mutating func apply(configuration: Any) throws

    Parameters

    configuration

    The untyped configuration value to apply.

  • validate() Default implementation

    Run a sanity check on the configuration, perform optional postprocessing steps and/or warn about potential issues.

    Default Implementation

    Declaration

    Swift

    mutating func validate() throws
  • supportedKeys Extension method

    All keys supported by this configuration.

    Declaration

    Swift

    var supportedKeys: Set<String> { get }