Skip to main content

EscalationPolicy

Trait EscalationPolicy 

Source
pub trait EscalationPolicy: Send + Sync {
    // Required methods
    fn initial_tier(&self) -> EscalationTier;
    fn should_escalate(
        &self,
        ctx: &ResponseContext,
        current: EscalationTier,
    ) -> Option<EscalationTier>;
    fn max_tier(&self) -> EscalationTier;
}
Expand description

Port trait for tiered request escalation.

Implementations decide:

The trait is purely synchronous — it contains no I/O. The pipeline executor (see T20) calls into the policy between tiers.

Required Methods§

Source

fn initial_tier(&self) -> EscalationTier

The tier to attempt first.

Source

fn should_escalate( &self, ctx: &ResponseContext, current: EscalationTier, ) -> Option<EscalationTier>

Given a response context and the current tier, return the next tier to try, or None to accept the current response.

Implementations should respect max_tier: if current >= self.max_tier(), return None.

Source

fn max_tier(&self) -> EscalationTier

The highest tier this policy is allowed to reach.

Implementors§