pub struct RoutingConfig {
pub routes: Vec<Route>,
}Fields§
§routes: Vec<Route>Implementations§
Source§impl RoutingConfig
impl RoutingConfig
Sourcepub fn resolve(&self, signal: &Signal) -> Vec<String>
pub fn resolve(&self, signal: &Signal) -> Vec<String>
Returns the provider names a signal should be delivered to, in
the order of RoutingConfig::plan.
Sourcepub fn plan(&self, signal: &Signal) -> DeliveryPlan
pub fn plan(&self, signal: &Signal) -> DeliveryPlan
Groups the matching routes’ providers into delivery targets.
Each provider of a fanout route is a target of its own. The
providers of every matching failover route share one target,
placed where the first of those routes is, so a config without
fanout delivers exactly as it always has: one ordered list that
stops at the first success.
CRITICAL INVARIANT: if no route matches, this MUST fall back to “console” rather than returning an empty plan. A signal that matches nothing must never silently disappear — that is the one failure mode that destroys trust in an alerting tool. See the architecture review: “unmatched signals always hit console at minimum.”
Sourcepub fn plan_with<F>(&self, signal: &Signal, admit: F) -> DeliveryPlan
pub fn plan_with<F>(&self, signal: &Signal, admit: F) -> DeliveryPlan
RoutingConfig::plan that first asks admit about each
matching route that sets dedup or rate_limit. A route it
turns down (with the reason) adds no providers.
Unlike plan, this can return no targets: when routes matched
and every one of them was suppressed. That is a decision the
config asked for, not a signal that matched nothing, so it does
not fall back to console; suppressed says why.
Trait Implementations§
Source§impl Clone for RoutingConfig
impl Clone for RoutingConfig
Source§fn clone(&self) -> RoutingConfig
fn clone(&self) -> RoutingConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more