Skip to main content

dpp_rules/lineage/
finding.rs

1//! What the lineage consent rule reports about an unsupported edge.
2
3/// Why one derivation edge is not supported by a transfer of responsibility.
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5#[non_exhaustive]
6pub enum ConsentDefect<'a> {
7    /// No transfer record corresponds to this predecessor at all, so the claim
8    /// to have taken responsibility rests on this operator's own assertion.
9    NoTransfer,
10    /// The outgoing operator never authorised the handover.
11    ///
12    /// The defect that matters most: without it there is no predecessor consent
13    /// at all, and the edge is exactly the unilateral assertion the rule exists
14    /// to catch.
15    OutgoingAuthorisationMissing,
16    /// The handover was never completed — still pending, or rejected, or
17    /// cancelled. An abandoned transfer does not support a live claim.
18    NotAccepted,
19    /// The transfer hands responsibility to someone other than this passport's
20    /// operator, so it is not evidence that *this* operator took it on.
21    IncomingOperatorMismatch {
22        /// This passport's operator.
23        expected: &'a str,
24        /// Who the transfer actually names.
25        found: &'a str,
26    },
27    /// A transfer exists but records a different operation than the edge claims.
28    ///
29    /// Art. 77(7)'s four operations carry different legal consequences, so the
30    /// two must name the same one.
31    OperationMismatch {
32        /// What the edge claims happened.
33        edge_operation: &'a str,
34        /// What the transfer records happened.
35        transfer_reason: &'a str,
36    },
37}
38
39/// One unsupported edge, identified by its position in the passport's list.
40#[derive(Debug, Clone, Copy, PartialEq, Eq)]
41pub struct ConsentFinding<'a> {
42    /// Index into the `derived_from` list as the caller passed it.
43    pub edge_index: usize,
44    /// What is wrong with it.
45    pub defect: ConsentDefect<'a>,
46}