pub enum ClassifierMode {
Answers(BTreeMap<String, Answer>),
Deterministic,
NotConfigured,
Rejected(String),
Transient {
retry_after: Option<Duration>,
},
Error(ClassifierError),
}Expand description
How a FakeClassifier answers, mirroring TextModelMode for the
classifier port (issue #456).
The fixed modes NotConfigured,
Rejected and Transient are the
three the port’s own contract names, and Error carries
any ClassifierError a test wants — between them every arm of a
caller’s error mapping is reachable, Transport included.
Variants§
Answers(BTreeMap<String, Answer>)
Answer exactly these, keyed by question id. A question the set asks that the map does not name falls back to the deterministic answer, so one test can script a subset and let the rest stay plausible.
Deterministic
Answer every question deterministically from its own labels (the default): the first label, with a plausible normalised distribution over all of them. A module under conformance gets a usable answer without scripting anything.
NotConfigured
Report the port is unwired (ClassifierError::NotConfigured).
Rejected(String)
A non-retryable refusal carrying the provider text.
Transient
A retryable failure with the provider’s back-off, where it said one.
Error(ClassifierError)
Exactly this error, text and all.