pub struct PdpRouter { /* private fields */ }Expand description
Dispatches PDP calls to the right resolver based on
Step::Pdp.call.dialect. Construct with new(), add resolvers via
register, then hand the router to a route handler.
Cloning is cheap (refcount bumps on each resolver Arc) — the
AplConfigVisitor snapshots its accumulated router into an Arc
for every installed route handler so a config reload that mutates
the visitor state doesn’t tear in-flight handlers.
Implementations§
Source§impl PdpRouter
impl PdpRouter
pub fn new() -> Self
Sourcepub fn register(&mut self, resolver: Arc<dyn PdpResolver>) -> &mut Self
pub fn register(&mut self, resolver: Arc<dyn PdpResolver>) -> &mut Self
Register a resolver for its declared dialect. If a resolver is
already registered for that dialect the new one is dropped and a
warning is logged — explicit replacement should go through
replace instead so the intent is visible at call sites.
Sourcepub fn replace(&mut self, resolver: Arc<dyn PdpResolver>) -> &mut Self
pub fn replace(&mut self, resolver: Arc<dyn PdpResolver>) -> &mut Self
Replace any existing resolver for the new resolver’s dialect. Use this when the host genuinely wants to swap in a different implementation (testing, A/B rollout).
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl PdpResolver for PdpRouter
impl PdpResolver for PdpRouter
Source§fn dialect(&self) -> PdpDialect
fn dialect(&self) -> PdpDialect
dialect() matches Step::Pdp.call.dialect.