expression
Separate authentication failures from transient transport errors
Retries must preserve the same verification policy. An authentication failure is not made safe by trying another unverified endpoint. A synthetic outcome enum separates authentication failure from transport failure; the latter still requires budget and operation-specific retry checks. Original policy model, not a certificate verifier. Expected stdout (not executed): stop and investigate assess retry budget stop Common mistake: Automatically downgrading verification or protocol security after a failed handshake.
Formal Syntax & Structure
rust syntaxrust
match failure { Authentication => stop, Transport => assess }Working Example
Example Snippetrust
fn main() { enum Failure { Authentication, Transport, Deadline } fn decide(f: Failure) -> &'static str { match f { Failure::Authentication => "stop and investigate", Failure::Transport => "assess retry budget", Failure::Deadline => "stop", } } for f in [Failure::Authentication, Failure::Transport, Failure::Deadline] { println!("{}", decide(f)); }}