1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Typed public impact contract for durable operation failures.
use crate;
/// Declares a diagnostic usable after accepted work fails durably.
///
/// Impact must cross the same explicit public-data boundary as evidence:
///
/// ```compile_fail
/// use recourse::{
/// catalog::{CatalogSpec, CodeNumber},
/// diagnostic::{DiagnosticType, NoEvidence},
/// operation::OperationDiagnosticType,
/// };
///
/// enum ExampleCatalog {}
/// impl CatalogSpec for ExampleCatalog {
/// const NAME: &'static str = "example";
/// const PREFIX: &'static str = "EXM";
/// const TYPE_BASE: &'static str = "https://example.invalid/problems/";
/// }
///
/// enum UnreviewedOperation {}
/// impl DiagnosticType for UnreviewedOperation {
/// type Catalog = ExampleCatalog;
/// type Evidence = NoEvidence;
/// const NUMBER: CodeNumber = CodeNumber::new(1);
/// const TITLE: &'static str = "Unreviewed operation";
/// const DETAIL: &'static str = "Its impact was not reviewed.";
/// const SUGGESTIONS: &'static [&'static str] = &[];
/// const DOCS: &'static str = "Review the impact type.";
/// }
/// impl OperationDiagnosticType for UnreviewedOperation {
/// type Impact = String;
/// }
/// ```