Skip to content

mapping

Structs

  • MappingRule - A validated mapping rule ready for matching.
  • MappingTable - Collection of validated, specificity-ordered mapping rules.

Enums

  • MappingTableError - Errors that can occur while building a [MappingTable] from configuration.
  • MatchResult - The result of matching a request against the mapping table.

firma_sidecar::normalizer::mapping::MappingRule

Section titled “firma_sidecar::normalizer::mapping::MappingRule”

Struct

A validated mapping rule ready for matching.

Fields:

  • method: Option<String>
  • host_pattern: String
  • path_pattern: Option<String>
  • action_class: String

firma_sidecar::normalizer::mapping::MappingTable

Section titled “firma_sidecar::normalizer::mapping::MappingTable”

Struct

Collection of validated, specificity-ordered mapping rules.

Loaded from TOML configuration at startup. Immutable after initialization.

Methods:

  • fn from_config(file: &MappingRulesFile, registry: &ActionClassRegistry, default_protected: bool) -> Result<Self, MappingTableError> - Load and validate mapping rules from a parsed config.
  • fn find_match<'a>(self: &'a Self, method: &str, host: &str, path: &str) -> MatchResult<'a> - Find the first (most specific) matching rule for a request.

Trait Implementations:

  • Clone
    • fn clone(self: &Self) -> MappingTable
  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result

firma_sidecar::normalizer::mapping::MappingTableError

Section titled “firma_sidecar::normalizer::mapping::MappingTableError”

Enum

Errors that can occur while building a [MappingTable] from configuration.

Variants:

  • InvalidRulesFile(String) - The mapping rules file itself failed validation (empty file,
  • DuplicateRule{ index: usize, rule: crate::config::MappingRuleConfig } - Two rules share the same (method, host, path) tuple, which
  • NonExistingActionClass{ index: usize, rule: crate::config::MappingRuleConfig } - A rule references an action class outside the built-in FEP

firma_sidecar::normalizer::mapping::MatchResult

Section titled “firma_sidecar::normalizer::mapping::MatchResult”

Enum

The result of matching a request against the mapping table.

Generic Parameters:

  • ‘a

Variants:

  • Matched(&'a MappingRule) - Matched a rule — use this action class.
  • UnclassifiedProtected - No rule matched and the host is protected — deny as unclassified.
  • NotProtected - No rule matched and the host is not protected — passthrough.

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result