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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! Errors raised by the sealed layer.
use String;
use Error;
/// Result type alias for sealed-layer operations.
pub type Result<T> = Result;
/// Errors raised by the envelope codec, address derivation and the canonical
/// signing-payload construction.
///
/// Every variant's `Display` string is byte-identical to the
/// `offline_protocol_mls::MlsError` variant it maps onto, because these types
/// moved out of that enum and their rendered text reaches logs, telemetry and
/// two test suites that assert on substrings of it.
///
/// # Why this enum is not `#[non_exhaustive]`
///
/// Its sibling `MlsError` is, and the difference is deliberate.
/// `From<SealedError> for MlsError` in the MLS crate must map every variant to
/// the one it replaced; `#[non_exhaustive]` would force that impl to carry a
/// wildcard arm, and a wildcard arm is exactly how a new variant added here
/// silently starts rendering as some other error's text. Leaving the enum
/// exhaustive makes adding a variant a compile error in the MLS crate until
/// someone maps it, which is the point. Adding a variant is a breaking change
/// for external consumers, and the workspace already moves every crate's
/// version together.