pub struct CompiledRoute {
pub route_key: String,
pub args: Vec<FieldRule>,
pub policy: Vec<Effect>,
pub result: Vec<FieldRule>,
pub post_policy: Vec<Effect>,
pub plugin_overrides: HashMap<String, PluginOverride>,
}Expand description
Compiler output for a single route.
One CompiledRoute per route_key. The compiler merges global / default /
tag / route-specific rules from the config hierarchy down into these four
phase lists before the evaluator sees them — the IR has no notion of
“tag rules” or “route overrides,” only “steps that fire in phase P.”
args and result are per-field pipelines (validators + transforms).
policy and post_policy are step lists — predicate-and-action rules
plus PDP calls, plugin invocations, and taint effects. See
apl-dsl-spec §1.2 / §4 / §7.
Fields§
§route_key: String§args: Vec<FieldRule>§policy: Vec<Effect>§result: Vec<FieldRule>§post_policy: Vec<Effect>§plugin_overrides: HashMap<String, PluginOverride>Per-plugin overrides declared on this route’s plugins: block.
Keyed by plugin name; merged at dispatch time via
EffectivePlugin::resolve(name, registry, &this.plugin_overrides).
Per spec only config, capabilities, on_error are overridable;
hooks/kind/source always come from the global declaration.
Implementations§
Source§impl CompiledRoute
impl CompiledRoute
pub fn new(route_key: impl Into<String>) -> Self
Sourcepub fn declared_phases(&self) -> PhaseSet
pub fn declared_phases(&self) -> PhaseSet
Which phases this route uses. Empty phases are not declared.
Sourcepub fn apply_layer(&mut self, more_specific: CompiledRoute)
pub fn apply_layer(&mut self, more_specific: CompiledRoute)
Apply a more-specific policy layer on top of this one. Used by orchestrators (apl-cpex’s visitor) to stack the unified-config hierarchy least-to-most-specific:
effective = CompiledRoute::default()
effective.apply_layer(global_block)
effective.apply_layer(default_block)
effective.apply_layer(tag_block)
effective.apply_layer(route_block)Each call adds the parameter on top of what’s already there;
more_specific wins on collisions because it represents a
later/narrower layer in the inheritance chain.
Merge semantics:
policy/post_policy:more_specific’s steps append after self’s. Earlier layers run first — globals deny before route-specific rules get a chance.args/result: per-field; if both layers declare the same field,more_specific’s rule replaces self’s. Fields only in self stay; fields only inmore_specificare added.plugin_overrides: HashMap merge;more_specificwins on key collisions, otherwise prefix’s entries fill gaps.
self.route_key is preserved — apply_layer doesn’t overwrite
identity, just policy content.
Trait Implementations§
Source§impl Clone for CompiledRoute
impl Clone for CompiledRoute
Source§fn clone(&self) -> CompiledRoute
fn clone(&self) -> CompiledRoute
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more