qualia_core_db/inference/conditioning/
receipt.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
4pub enum RequirementDisposition {
5 Applied,
6 Enforced,
7 Degraded,
8 Rejected,
9 NotApplicable,
10}
11
12#[derive(Debug, Clone, Copy)]
13pub struct RequirementOutcome<'a> {
14 pub id: &'a str,
15 pub disposition: RequirementDisposition,
16 pub reason: Option<&'a str>,
17}
18
19impl<'a> RequirementOutcome<'a> {
20 pub const fn applied(id: &'a str) -> Self {
22 Self {
23 id,
24 disposition: RequirementDisposition::Applied,
25 reason: None,
26 }
27 }
28
29 pub const fn enforced(id: &'a str) -> Self {
31 Self {
32 id,
33 disposition: RequirementDisposition::Enforced,
34 reason: None,
35 }
36 }
37
38 pub const fn degraded(id: &'a str, reason: &'a str) -> Self {
40 Self {
41 id,
42 disposition: RequirementDisposition::Degraded,
43 reason: Some(reason),
44 }
45 }
46
47 pub const fn rejected(id: &'a str, reason: &'a str) -> Self {
49 Self {
50 id,
51 disposition: RequirementDisposition::Rejected,
52 reason: Some(reason),
53 }
54 }
55}