pub enum LearnError {
AddressMismatch {
claimed: CandidateId,
derived: CandidateId,
},
UnaddressableContent(String),
InvalidTransition {
from: CandidateStatus,
action: &'static str,
},
ReceiptMismatch {
candidate_id: CandidateId,
named: CandidateId,
},
Refused(PromotionRefusal),
}Expand description
The learn plane’s typed errors: address integrity, lifecycle transitions, and promotion refusals. Refused operations change nothing — there is no silent no-op anywhere in the pipeline.
Variants§
AddressMismatch
A candidate’s id does not re-derive from its content — the tampered-candidate case, failing closed at the gate.
Fields
claimed: CandidateIdThe id the candidate claims.
derived: CandidateIdThe id its content derives.
UnaddressableContent(String)
The candidate’s content could not be serialized for addressing — unreachable for well-formed content, surfaced rather than panicked.
InvalidTransition
A lifecycle transition the state machine does not admit (e.g. promoting a candidate that was never evaluated, rolling back one that was never promoted).
Fields
from: CandidateStatusThe status the transition was attempted from.
ReceiptMismatch
A receipt presented for one candidate names another.
Fields
candidate_id: CandidateIdThe candidate the record holds.
named: CandidateIdThe candidate the receipt names.
Refused(PromotionRefusal)
The promotion gate refused.
Trait Implementations§
Source§impl Clone for LearnError
impl Clone for LearnError
Source§impl Debug for LearnError
impl Debug for LearnError
Source§impl Display for LearnError
impl Display for LearnError
Source§impl Error for LearnError
impl Error for LearnError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()